Compiling under VS2008: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Initial Edit)
 
mNo edit summary
Line 60: Line 60:
* In the Additional Options text box add in this '''/NODEFAULTLIB:"LIBCMTD"'''
* In the Additional Options text box add in this '''/NODEFAULTLIB:"LIBCMTD"'''
* Do the above 3 steps but on 'server_hl2mp'
* Do the above 3 steps but on 'server_hl2mp'
==Conclusion==
You should now be able to compile without any errors.
Have fun :)
~Haza

Revision as of 12:49, 15 November 2007

Introduction

In this tutorial you will be shown how to get the Source SDK up and running with Microsoft's Upcoming Visual Studio 2008.

Step 1

Create a project

If you haven't already, you need to create a new SDK project. To do this you must follow these steps:

  • 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. Also you will need a few hundred mb of disk space for compiling in.

You now have a fresh SDK installation.


Step 2

Copying Files

To continue in a non destructive way. We must copy our VS2005 files.

  • 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'


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.

OK.

We must now 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.

Once it is converted we are ready to go onto the next step.


Step 4

Last minute changes

If you have tried to compile already, you would have gotten some nasty errors.

To fix these we must suppress some libraries.

To do this follow these steps:

  • 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 text box add in this /NODEFAULTLIB:"LIBCMTD"
  • Do the above 3 steps but on 'server_hl2mp'