Compiling under VS2010: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(corrections and cleanup)
No edit summary
Line 1: Line 1:
'''Visual Studio 2010''' has a lot of great features, and can be used with the Source SDK fairly easily. It will be released on April 11 (April 12 for the free C++ Express edition), but can be used today in Release Candidate form.
'''Visual Studio 2010''' is the best VS edition for Source. You can use the free [http://www.microsoft.com/express/Downloads/#2010-Visual-CPP C++ Express] edition.


{{note|The earlier beta releases of VS2010 can't properly compile debug DLLs.}}
== Debugging ==
 
== Fixing Compilation ==


# Follow the instructions [[Compiling under VS2008#Fix debug compilation|for fixing debug compiles in VS2008]], which apply here as well.
# Follow the instructions [[Compiling under VS2008#Fix debug compilation|for fixing debug compiles in VS2008]], which apply here as well.
Line 10: Line 8:
== Fixing Warnings ==
== Fixing Warnings ==


You're going to be stuck with at least one warning during compilation, but you can get rid of some of them. Open these files in your client project and move <code>#include "cbase.h"</code> up to the first line:
If you want to remove the "precompiled header" warnings seen during a full compile, open these files in your client project and move <code>#include "cbase.h"</code> up to the first line:


# hud_locator.cpp
# hud_locator.cpp
# hud_credits.cpp
# hud_credits.cpp
# hud_flashlight.cpp
# hud_flashlight.cpp
You may also want to go to ''Configuration Properties->General'' for both projects and change the ''Intermediate Directory'' from <code>.\Release\</code> to <code>Release\</code>, removing the <code>.\</code>. (That this produces a warning is a bug that should be fixed in VS2010's final release.)


== See also ==
== See also ==


* [http://www.microsoft.com/visualstudio/en-us/ Visual Studio 2010]
* [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/ Visual Studio 2010]
* [[Launching from Visual Studio]]
* [[Launching from Visual Studio]]



Revision as of 03:38, 13 April 2010

Visual Studio 2010 is the best VS edition for Source. You can use the free C++ Express edition.

Debugging

  1. Follow the instructions for fixing debug compiles in VS2008, which apply here as well.
  2. Right click on the client and server projects in VS and go to Properties > Configuration > General. Change Target Name to client and server respectively.

Fixing Warnings

If you want to remove the "precompiled header" warnings seen during a full compile, open these files in your client project and move #include "cbase.h" up to the first line:

  1. hud_locator.cpp
  2. hud_credits.cpp
  3. hud_flashlight.cpp

See also