Sign in to follow this  
RaccoonKing

Trying to get an HL2 mod to compile..

Recommended Posts

Thanks in advance for reading. I'm new here so I hope you guys don't mind my first post being a question. All of the following was done according to valve's guide. I placed a link to that guide at the bottom of this post. Today I downloaded Visual C++ 2005 Express Edition Beta (not wanting to pay for Visual Studio .NET 2003 if possible) and loaded up game_sdk.sln Then (though I thought this odd) I opened a separate file called weapon_rpg.cpp from another location, and changed RPG_SPEED from 1500 to 400 like valve's guide said to do. Then I changed the Active Solution Configuration to "HL2 Release" like the guide said to do (despite the fact that I had to type that in, it wasn't a selectable option, which I found odd) I thought that these steps were going to work since I followed them and valve should know what they're talking about, but after compiling, 0 of 2 projects built successfully. The compile log is extremely long so I won't post it (I'm sorry if that's a mistake, just smack me, I'll fix it) If anyone has any idea what's going on, I'd really appreciate help, since I'm completely lost and have never compiled a mod before due to errors like this one. PS: This mod was created using the "Build a Mod From Scratch" option, and I created the mod in the directory C:\Documents and Settings\Username\My Programs\Steam\SteamApps\SourceMods\ModA Valve's Guide: http://www.valve-erc.com/srcsdk/MyFirstMod.htm

Share this post


Link to post
Share on other sites
From the Source SDK FAQ:

Quote:

What compiler do I need to build the SDK code?
The SDK is set up to be compiled with Microsoft Visual C++ .NET 2003 v7.1.

They even put the emphasis. Plus, I recall you that VC++2005 is a beta software.

Another FAQ entry:
Quote:

Where can I go for more help?
Read the SDK Release Notes for the information about the current Source SDK release.
The VERC Collective Forums are a great way to help get answers to problems you encounter.


I think you'll find help more easily on this forum than here when it comes to SDK related questions. Now, we are ready to answer any other question - see the game mod forum:)

Regards,

Share this post


Link to post
Share on other sites
Thanks Emmanuel. You're right about VERC.

code_master, here are the errors (besides the one I (think) I already fixed)

<code block A>

c:\documents and settings\raccoonking\my programs\steam\steamapps\sourcemods\moda\src\cl_dll\hud_bitmapnumericdisplay.cpp(159) : error C2668: 'pow' : ambiguous call to overloaded function


c:\documents and settings\raccoonking\my programs\steam\steamapps\sourcemods\moda\src\game_shared\baseentity_shared.cpp(251) : error C2440: 'initializing' : cannot convert from 'const char *' to 'char *'
Conversion loses qualifiers
basecombatweapon_shared.cpp
basecombatcharacter_shared.cpp
baseanimatedtextureproxy.cpp
base_playeranimstate.cpp


BSCMAKE: error BK1506 : cannot open file '.\debug_sdk\bitbuf.sbr': No such file or directory

</code block A>

Share this post


Link to post
Share on other sites
It looks as though your errors are just general c++ errors.

The first error to do with overloading the pow function can be solved by specifying the type that you are passing it. ie:-



pow( (long)2,2 );




The next set of errors can be resolved by typecasting the const chars to chars. ie:-



(char*)strString;


Share this post


Link to post
Share on other sites
I came across an article on Wavelength some time ago about compiling source sdk in vc++ 2005. Here's the link: http://articles.thewavelength.net/678/
I don't have 2005, so I can't promise that it will work.

Share this post


Link to post
Share on other sites
Both solutions are correct.

Quote:
Original post by rpg_code_master
It looks as though your errors are just general c++ errors.

The first error to do with overloading the pow function can be solved by specifying the type that you are passing it. ie:-

*** Source Snippet Removed ***

It seems the error comes from the definition of pow<T>(). Most of the time, it comes from a missing #include <math.h> (or #include <cmath>) - at least, this was true with VC6. Anyway, rpg_code_master's solution should work.

Quote:
Original post by rpg_code_master
The next set of errors can be resolved by typecasting the const chars to chars. ie:-

*** Source Snippet Removed ***


The correct C++ way to do it is to use const_cast<>:

char *str = const_cast<char*>(my_const_string);


Regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this