Compiling under VS2008
Introduction
In this tutorial you will be shown how to get the Source SDK up and running with Microsoft Visual Studio 2008. There's several things you're going to have to be willing to do to get it working. Despite what you might here however, this can be done.
Step 1
Create A New Project
If you haven't already, you need to create a new SDK project.
- Under the tool section of your steam client, launch the Source SDK.
- Click 'Create a Mod'.
- Choose one of the options(in this tutorial I used Hl2MP).
- Select a path to install it to, preferably not in your Steam folders. I recommend C:/*MODNAMEHERE*, as it'll be easy for you or anyone else to find if you need some files.
You should now have a fresh SDK installation in the folder you selected.
Step 2
Copying Files
To do all of this in a non-destructive way, we must copy our VS2005 files and make a new solution.
- Copy 'src/Game_HL2MP-2005.sln' and rename the copy to 'Game_HL2MP-2008.sln'.
- Copy 'src/cl_dll/client_hl2mp-2005.vcproj' and rename the copy to 'client_hl2mp-2008.vcproj'.
- Copy 'src/dlls/server_hl2mp-2005.vcproj' and rename the copy to 'server_hl2mp-2008.vcproj'.
You'll now have created a new project to work with.
This is important, as you don't want to go around messing up your entire SDK installation if you mess up.
Step 3
Modifying Files
With that done, we can now go ahead and modify our setup.
- Open the newly created 'Game_HL2MP-2008.sln' in a text editor.
- You should see 2 strings, "cl_dll\client_hl2mp-2005.vcproj" and "dlls\server_hl2mp-2005.vcproj". Change the 2005 in both of them to 2008.
- Save this file.
- Open Game_HL2MP-2008.sln in Visual Studio 2008. You will be prompted to upgrade the project files.
- At the first section of the upgrade process, you are asked if you want to create a backup before converting.
- We want to select no. Wait for the conversion process to complete, then press the Finish button. You should now automatically launch into your newly converted solution.
We don't need to backup anything because we did a better manual backup ourselves.
It's OK if the conversion process tells you that it complied with a few warnings, as this is normal.
This SDK was originally meant for VS2003, so there's bound to be some problems.
Step 4
Important Changes
Now it's time to go into our new solution and adjust some important settings.
If you have tried to compile already, you would have gotten some nasty errors.
To fix these we must suppress some libraries and make some other changes.
- With the project open in Visual Studio 2008, right click on 'client_hl2mp' in the Solution Explorer, and click Properties.
- Select the 'Configuration Properties -> Linker -> Input' tab.
- In the Ignore Specific Library text box add in this ,LIBCMTD. Make sure there is a comma between that and the other items in the box, or else there will be some serious issues.
- Repeat the above 3 steps on 'server_hl2mp'.
Good, now that that is complete, we're going to edit some more properties.
- With the project open in Visual Studio 2008, right click on 'client_hl2mp' in the Solution Explorer, and click Properties.
- Select the 'Configuration Properties -> Linker -> Command Line' tab.
- In the Additional Options box, add the following the way they are presented to you below:
/FORCE:MULTIPLE
/NODEFAULTLIB:LIBCMT
- Press Apply, then OK, and repeat the last 3 steps for 'server_hl2mp'.
Finally, we need to make sure we're compiling in Debug HL2MP.
- Right-click on 'Solution Game_HL2MP-2008' in your Solution Explorer and select Properties.
- Click the Configuration Properties option.
- Under the Configuration tab in the table that appears on the right of the window, use the selection box to chnage or verify that both solutions are set to 'Debug HL2MP'. Once you've done this, press Apply, then OK.
Your SDK installation should now be fully operational.
You'll still get some warnings, but you shouldn't get any more errors on your first build if you followed these steps.
I recommend you build now while the installation is still fresh so you don't have to do this again and so you know everything is working the way it should.
If you are still getting errors, keep retrying this tutorial until you don't anymore, as I've confirmed this works.