Raised This Month: $ Target: $400
 0% 

How do you build SourceMod extension on Windows?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 10-15-2016 , 01:55   How do you build SourceMod extension on Windows?
Reply With Quote #1

I'm struggling to build the sample SourceMod extension.
I read the wiki on ambuild and building SourceMod extension, and followed the exact instructions.

I already have alliedmodder repos cloned from the latest master branch.

Every time I try to "python ../configure.py" on the sample extension,

it outputs
"Exception: Unable to find a suitable CC compiler".

I do have Visual Studio 2013 & 2015 and Python 2.7 (mozilla build) installed.
dilalmon is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-15-2016 , 04:19   Re: How do you build SourceMod extension on Windows?
Reply With Quote #2

You need to run it from inside the Visual Studio x86 Native Tools Command Prompt.
__________________
asherkin is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 10-15-2016 , 13:41   Re: How do you build SourceMod extension on Windows?
Reply With Quote #3

I did. I tried using the 2013 one and 2015 one (x86 native).
I would browse to the build folder that's inside the source folder of the sample extension in the VS cmd prompt, and type "python ../configure.py".

I can see that python and git is already set for PATH.

Not sure what I'm doing it wrong.
dilalmon is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 10-17-2016 , 01:08   Re: How do you build SourceMod extension on Windows?
Reply With Quote #4

If you're running it from a normal commandline, try executing something like
Quote:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
before calling configure to setup your environment for msvc.
__________________
Peace-Maker is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 10-17-2016 , 08:54   Re: How do you build SourceMod extension on Windows?
Reply With Quote #5

I executed the batch file from command prompt. Not sure if it worked because it didn't output anything, but afterwards I tried "python ../configure.py" in the build folder of the sample extension and it still tells me "Exception: Unable to find a suitable CC compiler".

This is quite frustrating. Help...
dilalmon is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 10-17-2016 , 09:29   Re: How do you build SourceMod extension on Windows?
Reply With Quote #6

try (in command prompt):
PHP Code:
call "%VS120COMNTOOLS%\vsvars32.bat" 
Note: The batch file doesn't generate any output, to test if it works, try (in same command prompt):
PHP Code:
cl.exe 
If you get "Unknown batch command", it didn't work, otherwise, try running configure.py again (in same command prompt)
__________________
WildCard65 is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 10-17-2016 , 12:23   Re: How do you build SourceMod extension on Windows?
Reply With Quote #7

After running it, it still can't find the suitable CC compiler. This is so weird.

Code:
J:\CDevelopment\ProjectRepos\Git\SourceEngine1\alliedmodders\sourcemod\public\sample_ext\build>cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]
it seems to run cl just find too.
dilalmon 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 19:20.


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