Talk:Installing and Debugging the Source Code

From Valve Developer Community
Jump to: navigation, search

I am currently trying to find a way to build the SDK from the free Microsoft Visual C++ 2003 toolkit. Any help/contributions from you or Valve would be most appreciated. [Big Ev]

You should stop while you're ahead. Look for Microsoft Visual Studio .NET 2003 on eBay ;-) --wisemx 09:34, 13 Aug 2005 (PDT)
Not a bad idea Mark, I'll check out eBay. Also great HL2 tutorials page in your profile.[Big Ev]
Check out this. it should come with the full standard edition too -ts2do

I just installed the SDK for the first time, and tried to compile a new project just to make sure that everything worked. Of course, it didn't. :) client.dll compiled fine, but there were three link errors in the project for server.dll:

hl2mp_client.obj : error LNK2019: unresolved external symbol "void __cdecl Bot_RunAll(void)" (?Bot_RunAll@@YAXXZ) referenced in function "void __cdecl GameStartFrame(void)" (?GameStartFrame@@YAXXZ)

hl2mp_gamerules.obj : error LNK2019: unresolved external symbol "class CBasePlayer * __cdecl BotPutInServer(bool,int)" (?BotPutInServer@@YAPAVCBasePlayer@@_NH@Z) referenced in function "void __cdecl Bot_f(void)" (?Bot_f@@YAXXZ)

Debug_hl2mp/server.dll : fatal error LNK1120: 2 unresolved externals

The third error is pretty easy to understand. I was able to find the two function definitions for the first two errors, and noticed that the offending code for both was inside #ifdef DEBUG statements. Is the SDK not supposed to compile in debug mode, and only in release? Or is there something else that I missed? --ATimson 16:40, 17 Sep 2005 (PDT)

Yes, having a decent grasp of C++ and your compiler. --^Ben
Ok, sure I'm not an expert but I'm trying to learn. A little more help than pointing out my shortcomings will be appreciated. I have the same problem as ATimson. Please help. --curVV

filesystem_steam.dll causing crash

I had a problem starting a debug session when I went through this tutorial. I got an Unresolved Exception in filesystem_steam.dll. After some time, I figured out that you need to add "" to the path that follows the -game command argument, if the path contains spaces. In my case i had to set my command argument to -dev -sw -game "C:\Games\Valve\Steam\SteamApps\SourceMods\My Mod"

Hope this can help someone...

Debugging with multiple GCF's?

I find that I'm unable to debug unless I comment out all of my MountSteamContent's. It produces an error like Appid is 320 something something.

Once commented out it works fine but with obvious missing content.

Garry what up!!! lol—ts2do (talk) 12:39, 15 Oct 2005 (PDT)

Applying Debugging Options

One thing i have noticed here, if you do not see your hl2.exe in the specified working directory, you must simply run the game type you are trying to mod. So in teh case of the tutorial, just run HL2 after installing the SDK and your ready.

Fresh installation, fresh errors

Im using a copy of Visual Studio 2005, freshly installed, nothing changed or edited. I just used the "Create a Mod" wizard and hit "Rebuild Solution" on the game_sdk.sln. Nothing compiles and i get tonnes of errors and even more warnings. On both Debug and Release configurations. What am i doing wrong?[Kyle (SneakyNinja)]

Maybe nothing. The SDK was created with an earlier version of Visual Studio. It's not at all unusual for things to break in this situation. I haven't tried it on VS2005 yet, and can't get to it this week, either, but hopefully someone else can. —Maven (talk) 15:48, 6 Dec 2005 (PST)
You did nothing wrong, currently, the source code does not compile with VS 2005. Valve has said they are working on fixing that but currently it's incompatible. [dleidlein]
Here is the updated information for VS 2005.

link VS2005 --Irish 10:54, 2 Mar 2007 (PST)

Debugging Issues

09.11.06 I have followed these directions for running in the debugger and have been unsuccessful. I have built a HL2MP mod (no errors, code is unchanged from the extract) and cannot run in the debugger. Upon entering in the command parameters and running the debugger, I recieve a popup in VS2003:

Unhandled exception at 0x0d101edf in hl2.exe: 0xC0000005: Access violation reading location 0x00000000. Unsigned comment added by Reacheround (talkcontribs). Please use four tildes (~~~~) to sign your username.

Try running the game (single player HL2 of HL2DM) then running your mod, sometimes that works. --Daktor 07:21, 9 Nov 2006 (PST)
I was able to rebuild all with 5 warnings, but when I run it, the New Game button takes me to a blank "New Game" screen where the "Start New Game" button does nothing. Should I chalk this up to a VS 2005 issue, still? --Nebrekker 17:59, 16 Jan 2007 (PST)

The instructions reference things that aren't there, I get errors, but . . . it works?

Compile the Source Code "Navigate to the directory where you installed the source code. In our example, it would be C:\MyMod\Src. Open the game_sdk.sln file." I didn't see a game_sdk.sln file. Rather, I saw
Everything_SDK-2003.sln
Everything_SDK-2005.sln
Game_HL2-2003.sln
Game_HL2-2005.sln
I choose Game_HL2-2005.sln. At the end of the process, I did indeed have two new dll's in the other folder. Then the Note, "Note: It seems that as of the August 2006 SourceSDK update, using the parameters specified above can lead to a “No Entry Point Found” error when trying to run the game from Visual Studio to debug the code. Use the parameters listed below:" Isn't this what a wiki is all about? If the parameters change, edit the parameters to be correct. The previous version is always there in the History of the article if anyone needs to look at it. Anyway, the note said to enter the Command line as C:\Steam\SteamApps\Username\source sdk base\hl2.exe But there is no "source sdk base" folder under my Username folder, just the hl2.exe file. So I ignored the note. Then, when I tried to run an instance, it failed, giving me some error message that told me that Steam had to be open. So I opened Steam and it failed again. So I opened the Source SDK and then tried to run an instance. This time it gave me some errors, "The procedure entry point CommandLine_Tier0 could not be located in the dynamic link library tier0.dll." It gave that error twice. Then it said: "The procedure entry point Q_NormalizeUTF8 could not be located in the dynamic link library vstdlib_s.dll." Then it gave the first error two more times. But then it actually started the game. So, it seems to work, but there are some miscrepencies and errors in the process somewhere. Banaticus -- BAH 01:19, 22 Mar 2007 (PDT)

"Create a Mod" tool crashes

In this tutorial, when I get to the part "Run the Create a Mod wizard", "Click the Next button ...", the installer crashes after copying most of the files and I get a request to send an error report from my system. I have run the procedure several times and every time it appears to crash when trying to copy the file, hl2_Spanish.txt.--HLUser 09:32, 8 Apr 2007 (PDT)

Refresh your SDK Content. Validate your Caches are good. Reinstall Hl2. Etc. --Sortie 01:51, 9 Apr 2007 (PDT)

Call me crazy...

Call me crazy, but shouldn't this section be updated if it's out of date??

If you can't find the Source SDK Base 2007

Try running the Source SDK Base at least once in Steam. After the run, it should show up in it's proper location (C:\Program Files\Steam\steamapps\USERNAME\source sdk base 2007).

-[midnightstar312]


Diagnostic about map files

The map file option suggested, "+map my_map" produces a diagnostic when run,

CModelLoader::Map_IsValid:  No such map 'maps/my_map.bsp'
map load failed: my_map not found or invalid

It's not the Visual Studio /MAP:file mapfile, so I suspect it might be a game map that we don't have in the 2013 version.