Raised This Month: $51 Target: $400
 12% 

Can someone explain me HOW to COMPILE extension under Windows, please!


Post New Thread Reply   
 
Thread Tools Display Modes
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 09:52   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #11

Quote:
Originally Posted by WildCard65 View Post
You can manually patch your AMBuild install before or after you run setup.py.
For before, you can do 1 of 2 ways:

1) Manually write in the changes to the files in PR powerlord linked.
OR
2) Merge in the PR if you cloned AMBuild from github(with the github command).

After you can do option 1 from above.
Your pull request fixed this problem. Thanks, but now I have another problem:
HTML Code:
C:\libs\sourcemod-master\public\testproject>python configure.py
Warning: build is being configured in the source tree.
Re-using build folder: obj-windows-AMD64
Traceback (most recent call last):
  File "configure.py", line 23, in <module>
    builder.Configure()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\prep.py", line 121, in Configure
    if not builder.generate():
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 274, in generate
    self.parseBuildScripts()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 183, in parseBuildScripts
    self.evalScript(root)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 243, in evalScript
    exec(code, new_vars)
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 435, in
 <module>
    Extension.detectSDKs()
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 95, in
detectSDKs
    raise Exception('Could not find a valid path for {0}'.format(sdk.envvar))
Exception: Could not find a valid path for HL2SDKND

C:\libs\sourcemod-master\public\testproject>
I want to compile this project only for TF2. What I'm doing wrong again?
And I also have one question. Which SDK is needed to compile extension for TF2? SDK2013 or TF2 sdk?
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-23-2016 at 09:55.
Naydef is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-23-2016 , 10:06   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #12

add this to your command line for running "configure.py": --sdks tf2
By default, the AMBuildScript uses all the defined SDKs in itself.
It looks for them by:
  1. Check if the option value for "--hl2sdk-root" is not None(Path to folder containing all the cloned SDK folders), if given, find respective SDK folder in given path.
  2. Check if the respective environment variable(eg: HL2SDKTF2) is set(Path to respective SDK folder(eg: D:\SMDEV\hl2sdk-tf2)), if set, use it's value.
  3. Otherwise look for respective SDK folder in a recursive ".." check.
  4. If none of the above finds the respective SDK folder or path obtained isn't a directory, error out with message saying which SDK couldn't be located.

Last edited by WildCard65; 02-23-2016 at 10:19.
WildCard65 is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 10:16   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #13

More errors:
HTML Code:
C:\libs\sourcemod-master\public\testproject>python configure.py --sdks tf2
Warning: build is being configured in the source tree.
Re-using build folder: obj-windows-AMD64
Traceback (most recent call last):
  File "configure.py", line 23, in <module>
    builder.Configure()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\prep.py", line 121, in Configure
    if not builder.generate():
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 274, in generate
    self.parseBuildScripts()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 183, in parseBuildScripts
    self.evalScript(root)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 243, in evalScript
    exec(code, new_vars)
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 435, in
 <module>
    Extension.detectSDKs()
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 114, in
 detectSDKs
    raise Exception('Could not find a source copy of SourceMod')
Exception: Could not find a source copy of SourceMod

C:\libs\sourcemod-master\public\testproject>
What is this again?
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-23-2016 , 10:19   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #14

The error says what it means, the AMBuildScript couldn't locate a source copy of SourceMod, check your AMBuildScript to see what it expects to find for either Env variable or folder names(see my editted reply above).

Last edited by WildCard65; 02-23-2016 at 10:20.
WildCard65 is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 12:23   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #15

Ok, I set up the environment variables correctly to Sourcemod and Metamod:Source, but now the program can't find Visual C++ compiler. I have Visual Studio. Where I have to set the path to visual studion compiler?:
HTML Code:
C:\libs\sourcemod-master\public\testproject>python configure.py --sdks tf2
Warning: build is being configured in the source tree.
Re-using build folder: obj-windows-AMD64
Checking CC compiler (vendor test msvc)... ['cl', 'test.c', '-o', 'test.exe', '-
nologo', '-showIncludes']
not found
Checking CC compiler (vendor test gcc)... ['cl', 'test.c', '-o', 'test.exe']
not found
Traceback (most recent call last):
  File "configure.py", line 23, in <module>
    builder.Configure()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\prep.py", line 121, in Configure
    if not builder.generate():
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 274, in generate
    self.parseBuildScripts()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 183, in parseBuildScripts
    self.evalScript(root)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 243, in evalScript
    exec(code, new_vars)
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 436, in
 <module>
    Extension.configure()
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 131, in
 configure
    cxx = builder.DetectCompilers()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 103, in DetectCompilers
    self.compiler = self.generator.detectCompilers().clone()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\amb2\gen.py", line 201, in detectCompilers
    self.base_compiler = detect.DetectCxx(os.environ, self.options)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\cpp\detect.py", line 56, in DetectCxx
    cc = DetectCxxCompiler(env, 'CC')
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\cpp\detect.py", line 97, in DetectCxxCompiler
    raise Exception('Unable to find a suitable ' + var + ' compiler')
Exception: Unable to find a suitable CC compiler
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 14:26   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #16

Is this a problem with ambuild?
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-23-2016 , 14:27   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #17

Run it from the Visual Studio x86 tools cmd prompt.
__________________
asherkin is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 14:30   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #18

This seems to get more sophisticated than I expected, but I will try to run from the VS prompt as you suggest
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-23-2016 at 14:30.
Naydef is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 14:47   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #19

I opened the command prompt, but this again:
HTML Code:
ERROR: Cannot determine the location of the VS Common Tools folder.

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC>cd cd C:\libs\sourcemod-m
aster\public\testproject
The filename, directory name, or volume label syntax is incorrect.

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC>cd C:\libs\sourcemod-mast
er\public\testproject

C:\libs\sourcemod-master\public\testproject>dir
 Volume in drive C has no label.
 Volume Serial Number is 103A-1B24

 Directory of C:\libs\sourcemod-master\public\testproject

02/23/2016  04:42 PM    <DIR>          .
02/23/2016  04:42 PM    <DIR>          ..
02/07/2016  12:56 AM               951 AMBuilder
02/07/2016  12:56 AM            14,946 AMBuildScript
02/07/2016  12:56 AM             1,164 configure.py
02/18/2016  09:15 PM             1,898 extension.cpp
02/18/2016  09:52 PM             4,345 extension.h
02/21/2016  04:34 PM             6,240 extension.obj
02/07/2016  12:56 AM             6,304 Makefile
02/18/2016  07:30 PM    <DIR>          msvc10
02/21/2016  04:44 PM    <DIR>          msvc12
02/18/2016  07:30 PM    <DIR>          msvc8
02/18/2016  07:30 PM    <DIR>          msvc9
02/23/2016  07:17 PM    <DIR>          obj-windows-AMD64
02/07/2016  12:56 AM             1,299 PackageScript
02/18/2016  09:06 PM             3,142 smsdk_config.h
               9 File(s)         40,289 bytes
               7 Dir(s)  151,560,216,576 bytes free

C:\libs\sourcemod-master\public\testproject>python configure.py --sdks tf2
Warning: build is being configured in the source tree.
Re-using build folder: obj-windows-AMD64
Checking CC compiler (vendor test msvc)... ['cl', 'test.c', '-o', 'test.exe', '-
nologo', '-showIncludes']
not found
Checking CC compiler (vendor test gcc)... ['cl', 'test.c', '-o', 'test.exe']
not found
Traceback (most recent call last):
  File "configure.py", line 23, in <module>
    builder.Configure()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\prep.py", line 121, in Configure
    if not builder.generate():
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 274, in generate
    self.parseBuildScripts()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 183, in parseBuildScripts
    self.evalScript(root)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 243, in evalScript
    exec(code, new_vars)
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 436, in
 <module>
    Extension.configure()
  File "C:\libs\sourcemod-master\public\testproject\AMBuildScript", line 131, in
 configure
    cxx = builder.DetectCompilers()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\base\gen.py", line 103, in DetectCompilers
    self.compiler = self.generator.detectCompilers().clone()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\amb2\gen.py", line 201, in detectCompilers
    self.base_compiler = detect.DetectCxx(os.environ, self.options)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\cpp\detect.py", line 56, in DetectCxx
    cc = DetectCxxCompiler(env, 'CC')
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\ambuild2\frontend\v
2_0\cpp\detect.py", line 97, in DetectCxxCompiler
    raise Exception('Unable to find a suitable ' + var + ' compiler')
Exception: Unable to find a suitable CC compiler

C:\libs\sourcemod-master\public\testproject>
But I noticed the error on the top:
HTML Code:
ERROR: Cannot determine the location of the VS Common Tools folder.
Maybe this is the problem?
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-23-2016 , 16:03   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #20

I will reinstall Visual Studio tomorrow, to fix this complete mess with compiling sm exts!
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-23-2016 at 16:04.
Naydef is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode