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

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-24-2016 , 06:57   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #21

Good news. I managed to fix the above error "ERROR: Cannot determine the location of the VS Common Tools folder."(here the link) And I successfully compiled the extension with the above command. But now the binary is with extension ".exe". Is it the right binary? I need to rename it to ".ext.dll"? Also the binary is in a folder named
HTML Code:
C:\libs\sourcemod-master\public\testproject\obj-windows-AMD64\.ambuild2
Maybe the binary file is 64-bit . How to force the compiler to create 32-bit binary file?

Edit: Actually this is not my own test file. If I try to execute it, it shows "msvc CC". Is this a test file? How to compile the real project?
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-24-2016 at 07:01.
Naydef is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-24-2016 , 07:06   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #22

.ambuild2 is AMB2's internal files, the extension build won't be in there.
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-24-2016 , 07:11   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #23

Did you run "ambuild" after running "configure.py"?
WildCard65 is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-24-2016 , 07:20   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #24

Quote:
Originally Posted by WildCard65 View Post
Did you run "ambuild" after running "configure.py"?
No, I will try

Edit: This happens:
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']
found msvc version 1800
Checking CXX compiler (vendor test msvc)... ['cl', 'test.cpp', '-o', 'testp.exe'
, '-nologo', '-showIncludes']
found msvc version 1800

C:\libs\sourcemod-master\public\testproject>ambuild
Error: folder was not configured for AMBuild.

C:\libs\sourcemod-master\public\testproject>cd
I will try with the official sample test project
Edit 2: I will redownload the whole sourcemod repo
Edit 3: The same text appears, even with redownloaded repo of the Sourcemod
HTML Code:
C:\libs\sourcemod-master\public>cd sample_ext

C:\libs\sourcemod-master\public\sample_ext>python configure.py --sdks tf2
Warning: build is being configured in the source tree.
Creating "obj-windows-AMD64" as a build folder.
Checking CC compiler (vendor test msvc)... ['cl', 'test.c', '-o', 'test.exe', '-
nologo', '-showIncludes']
found msvc version 1800
Checking CXX compiler (vendor test msvc)... ['cl', 'test.cpp', '-o', 'testp.exe'
, '-nologo', '-showIncludes']
found msvc version 1800

C:\libs\sourcemod-master\public\sample_ext>ambuild
Error: folder was not configured for AMBuild.

C:\libs\sourcemod-master\public\sample_ext>
Edit 4: Is it required to open configure.py and modify the path variables inside?
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-24-2016 at 07:30.
Naydef is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-24-2016 , 08:27   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #25

No, you need to run the command "ambuild" inside the folder containing the ".ambuild2" folder, in your case, the folder named "obj-windows-AMD64", basically AMBuild is setup to designate a build folder as followed:
A) Use current folder that "configure.py" is being executed in as long as it's not the source folder(folder containing the AMBuildScript file).
OR(If configure.py is executed in source folder):
B) Use the default build folder and notify user what it is.

Example:
Say I have made personal modifications to SourceMod that will only be deployed on servers I own.
Say I have said source copy of SM in the following path: <path to Documents>/sourcemod.
Say I want to build SM in a folder called "build", I run the following commands:
A)
Code:
mkdir build && cd build
B)
Code:
python ../configure.py --enable-optimize
Note above I don't specify any specific SDKs I want to build, by default, it uses ALL of then, it won't error out as I setup my env variables for all SDKs SM can be built against(all of the hl2sdks + MMSource 1.10 source + mysql 5.0 source are in D:\SMDev)
Now I'm ready to build, I then run "ambuild" inside the folder called "build".

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

Ok, so to explain in simple language:
1. First I create a folder named "build" with command "mkdir build", which is located at "C:\libs\sourcemod-master\public\sample_ext".
2. Then, I enter in this folder with command "cd build"
3. After that, I enter the command "python C:\libs\sourcemod-master\public\sample_ext\configure.py --enable-optimize"
4. The final step is to enter "ambuild"
5. Is this all?

Did I understand correctly?

I've done this procedures, but now again another error(s):
HTML Code:
C:\libs\sourcemod-master\public\sample_ext\build>ambuild
[create] mkdir -p sample.ext.2.tf2
[create] mkdir -p package
[create] mkdir -p package\addons
[create] mkdir -p package\addons\sourcemod
[create] mkdir -p package\addons\sourcemod\extensions
Spawned taskmaster (pid: 7860)
Spawned worker (pid: 6540)
Spawned worker (pid: 6956)
[6540] cl /MT /W3 /Ox /Zo /Oy- /Zi /FS /EHsc /GR- /TP /D_CRT_SECURE_NO_DEPRECATE
 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_ITERATOR_DEBUG_LEVEL=0
 /DNDEBUG /DWIN32 /D_WINDOWS /DSE_EPISODEONE=1 /DSE_CSGO=20 /DSE_BLOODYGOODTIME=
4 /DSE_EYE=5 /DSE_CONTAGION=14 /DSE_ORANGEBOX=3 /DSE_INSURGENCY=19 /DSE_DARKMESS
IAH=2 /DSE_BLADE=18 /DSE_BMS=10 /DSE_LEFT4DEAD=12 /DSE_DODS=8 /DSE_HL2DM=7 /DSE_
LEFT4DEAD2=15 /DSE_SDK2013=9 /DSE_CSS=6 /DSE_TF2=11 /DSE_ALIENSWARM=16 /DSE_NUCL
EARDAWN=13 /DSE_DOTA=21 /DSE_PORTAL2=17 /DSOURCE_ENGINE=11 /DCOMPILER_MSVC /DCOM
PILER_MSVC32 /I ..\..\.. /I ..\.. /I ..\..\sdk /I ..\..\.. /I ..\..\..\extension
s /I ..\..\..\..\sourcepawn\include /I ..\..\..\amtl\amtl /I ..\..\..\amtl /I ..
\..\..\..\..\metamod-source-master\core /I ..\..\..\..\..\metamod-source-master\
core\sourcehook /I ..\..\..\..\..\hl2sdk-tf2\public /I ..\..\..\..\..\hl2sdk-tf2
\public\engine /I ..\..\..\..\..\hl2sdk-tf2\public\mathlib /I ..\..\..\..\..\hl2
sdk-tf2\public\vstdlib /I ..\..\..\..\..\hl2sdk-tf2\public\tier0 /I ..\..\..\..\
..\hl2sdk-tf2\public\tier1 /I ..\..\..\..\..\hl2sdk-tf2\public\game\server /I ..
\..\..\..\..\hl2sdk-tf2\public\toolframework /I ..\..\..\..\..\hl2sdk-tf2\game\s
hared /I ..\..\..\..\..\hl2sdk-tf2\common /showIncludes /nologo /c C:\libs\sourc
emod-master\public\sample_ext\extension.cpp /Foextension.obj
extension.cpp
C:\libs\sourcemod-master\public\IShareSys.h(40) : fatal error C1083: Cannot open
 include file: 'sp_vm_types.h': No such file or directory

[6956] cl /MT /W3 /Ox /Zo /Oy- /Zi /FS /EHsc /GR- /TP /D_CRT_SECURE_NO_DEPRECATE
 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_ITERATOR_DEBUG_LEVEL=0
 /DNDEBUG /DWIN32 /D_WINDOWS /DSE_EPISODEONE=1 /DSE_CSGO=20 /DSE_BLOODYGOODTIME=
4 /DSE_EYE=5 /DSE_CONTAGION=14 /DSE_ORANGEBOX=3 /DSE_INSURGENCY=19 /DSE_DARKMESS
IAH=2 /DSE_BLADE=18 /DSE_BMS=10 /DSE_LEFT4DEAD=12 /DSE_DODS=8 /DSE_HL2DM=7 /DSE_
LEFT4DEAD2=15 /DSE_SDK2013=9 /DSE_CSS=6 /DSE_TF2=11 /DSE_ALIENSWARM=16 /DSE_NUCL
EARDAWN=13 /DSE_DOTA=21 /DSE_PORTAL2=17 /DSOURCE_ENGINE=11 /DCOMPILER_MSVC /DCOM
PILER_MSVC32 /I ..\..\.. /I ..\.. /I ..\..\sdk /I ..\..\.. /I ..\..\..\extension
s /I ..\..\..\..\sourcepawn\include /I ..\..\..\amtl\amtl /I ..\..\..\amtl /I ..
\..\..\..\..\metamod-source-master\core /I ..\..\..\..\..\metamod-source-master\
core\sourcehook /I ..\..\..\..\..\hl2sdk-tf2\public /I ..\..\..\..\..\hl2sdk-tf2
\public\engine /I ..\..\..\..\..\hl2sdk-tf2\public\mathlib /I ..\..\..\..\..\hl2
sdk-tf2\public\vstdlib /I ..\..\..\..\..\hl2sdk-tf2\public\tier0 /I ..\..\..\..\
..\hl2sdk-tf2\public\tier1 /I ..\..\..\..\..\hl2sdk-tf2\public\game\server /I ..
\..\..\..\..\hl2sdk-tf2\public\toolframework /I ..\..\..\..\..\hl2sdk-tf2\game\s
hared /I ..\..\..\..\..\hl2sdk-tf2\common /showIncludes /nologo /c C:\libs\sourc
emod-master\public\smsdk_ext.cpp /FoC_libs_sourcemod_master_public_smsdk_ext.obj

smsdk_ext.cpp
C:\libs\sourcemod-master\public\IShareSys.h(40) : fatal error C1083: Cannot open
 include file: 'sp_vm_types.h': No such file or directory

Build failed.

C:\libs\sourcemod-master\public\sample_ext\build>
__________________
My plugins:
*None for now*


Steam:
naydef

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

You probably forgot to add "--recursive" to the git clone command(like I do a lot...)
If so, run the following in the sourcemod folder:
Code:
git submodule init
git submodule update
Then run "ambuild" again.
If all goes right, it should compile.

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

Git? Is it possible without git? I have to do again all procedures. Anyway, I will install git and try again
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-24-2016 at 09:42.
Naydef is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-24-2016 , 10:00   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #29

Yes, you can download each submodule and insert it into the right place in the SourceMod tree - but why bother with that when git will manage it for you.
__________________
asherkin is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-24-2016 , 10:07   Re: Can someone explain me HOW to COMPILE extension under Windows, please!
Reply With Quote #30

This mean merging sourcepawn-master and sourcemod-master. I will use git the next time I create an extension. But now I just want to compile the sample
Edit: Anyway, downloaded git program and done all procedures suggested by WildCard65, but I suppose I need to set the environment variables path again. I will now try again
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 02-24-2016 at 10:14.
Naydef is offline
Reply


Thread Tools
Display Modes

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 09:56.


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