Compiling under VS2010: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 17: Line 17:
Es gibt einen [http://connect.microsoft.com/VisualStudio/feedback/details/603666/custom-build-steps-do-not-run-in-visual-c-visual-studio-2010#details bug] in VS2010, welcher manchmal verhindert das die neu kompilierten DLLs in das Verzeichniss deiner Mod kopiert verden. Um das zu verhindern, rechtsklicke jeweils das Client- und dass Server-Projekt in VS und wähle ''Einstellungen'' (''Properties'') aus. Verändere das drop-down Menü ''Konfiguration'' (''Configuration'') oben links zu ''Alle Konfigurationen'' (''All Configurations''). Danach wähle ''Konfigurationseigenschaften > Benutzerdefinierter Buildschritte'' (''Configuration Properties > Custom Build Step'') und gebe im Feld ''Zusätzliche Abbhängigkeiten'' (''Additional Dependencies'') "''$(TargetPath)''" ein.
Es gibt einen [http://connect.microsoft.com/VisualStudio/feedback/details/603666/custom-build-steps-do-not-run-in-visual-c-visual-studio-2010#details bug] in VS2010, welcher manchmal verhindert das die neu kompilierten DLLs in das Verzeichniss deiner Mod kopiert verden. Um das zu verhindern, rechtsklicke jeweils das Client- und dass Server-Projekt in VS und wähle ''Einstellungen'' (''Properties'') aus. Verändere das drop-down Menü ''Konfiguration'' (''Configuration'') oben links zu ''Alle Konfigurationen'' (''All Configurations''). Danach wähle ''Konfigurationseigenschaften > Benutzerdefinierter Buildschritte'' (''Configuration Properties > Custom Build Step'') und gebe im Feld ''Zusätzliche Abbhängigkeiten'' (''Additional Dependencies'') "''$(TargetPath)''" ein.


== IsBIK error ==
== IsBIK Error ==


First, save [https://developer.valvesoftware.com/wiki/Source_SDK_missing_files ibik.h] to <code>src/public/avi/ibik.h</code>.
Zuerst speichere [https://developer.valvesoftware.com/wiki/Source_SDK_missing_files ibik.h] in <code>src/public/avi/ibik.h</code> ab.
Then in <code>src/game/client/enginesprite.h</code>, add to the include list:
Dann füge folgendes zur Includelist von <code>src/game/client/enginesprite.h</code> hinzu:


<source lang=cpp>
<source lang=cpp>
Line 26: Line 26:
</source>
</source>


Next, add the highlighted lines towards the bottom:
Als nächstes musst Du die folgenden Zeilen Code in der Nähe von Zeile ''53'' (irgentwo am Ende) hinzufügen:


<source lang=cpp highlight=2,7>
<source lang=cpp highlight=2,7>
Line 37: Line 37:
BIKMaterial_t m_hBIKMaterial;</source>
BIKMaterial_t m_hBIKMaterial;</source>


Now open <code>spritemodel.cpp</code> (located in the same directory) and add the following:
Als letztes musst Du <code>spritemodel.cpp</code>(im selben ordner) öffnen und da wo Platz ist das hir hinzufügen:


<source lang=cpp>
<source lang=cpp>

Revision as of 08:09, 13 October 2012

Template:Otherlang2

Visual studio logo.png

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

Icon-Bug.pngBug:Converting the Alien Swarm server project to VS2010 will lead to an "invalid characters in path" error. To fix it, open game\server\swarm_sdk_server.vcproj with a text editor and delete "' $File" from line 2232.  [todo tested in ?]

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 Properties > General. Change Target Name to client and server respectively.

File Copying

Es gibt einen bug in VS2010, welcher manchmal verhindert das die neu kompilierten DLLs in das Verzeichniss deiner Mod kopiert verden. Um das zu verhindern, rechtsklicke jeweils das Client- und dass Server-Projekt in VS und wähle Einstellungen (Properties) aus. Verändere das drop-down Menü Konfiguration (Configuration) oben links zu Alle Konfigurationen (All Configurations). Danach wähle Konfigurationseigenschaften > Benutzerdefinierter Buildschritte (Configuration Properties > Custom Build Step) und gebe im Feld Zusätzliche Abbhängigkeiten (Additional Dependencies) "$(TargetPath)" ein.

IsBIK Error

Zuerst speichere ibik.h in src/public/avi/ibik.h ab. Dann füge folgendes zur Includelist von src/game/client/enginesprite.h hinzu:

#include "avi/ibik.h"

Als nächstes musst Du die folgenden Zeilen Code in der Nähe von Zeile 53 (irgentwo am Ende) hinzufügen:

bool IsAVI();
bool IsBIK();
void GetTexCoordRange( float *pMinU, float *pMinV, float *pMaxU, float *pMaxV );
 
private:
AVIMaterial_t m_hAVIMaterial;
BIKMaterial_t m_hBIKMaterial;

Als letztes musst Du spritemodel.cpp(im selben ordner) öffnen und da wo Platz ist das hir hinzufügen:

bool CEngineSprite::IsBIK()
{
	return ( m_hBIKMaterial != BIKMATERIAL_INVALID );
}

Fixing Other Compiling Errors

Error LNK2005: ... already defined in memoverride.obj
See Compiling under VS2008#Fix debug compilation.
Linker Errors relating to LIBC, LIBCMT, LIBCD, LIBCMTD
Go to the client project's Properties->Linker->Input->Ignore Specific Default Libraries and enter libc;libcmtd;libcd;. Navigate to the same place in the server project properties and enter libcd;libcmtd;.
Cannot locate "gl/glaux.h" (glview only)
Remove the line #include <gl/glaux.h> from glview.cpp (can be found in src/utils/glview). Then right-click on the project and go to Properties->Configuration Properties->Linker->Input and under Additional Dependencies remove glaux.lib.
Warning MSB8012: TargetPath does not match the Linker's OutputFile property ...
Go to Properties->Configuration Properties->General. Change the values in Output Directory, Intermediate Directory, Target Name, and Target Extension to match the Linker's OutputFile property value given in the error message.
fatal error C1083: Cannot open include file: 'weapon_sdkbase.h': No such file or directory
See article: http://developer.valvesoftware.com/wiki/Source_SDK_missing_files

Precompiled Headers

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

First-chance exception at 0x00000000

If Client compiles but Server does not, and you have set your mod up for debugging, hl2.exe will crash with extremely ambiguous information. To prevent the game from running if Server does not successfully compile, right click the client project file and select Project Dependencies. Check the checkbox for Server and then click OK.

Compiling Under Linux

VS 2010 introduces a new project file format (.vcxproj) which is not compatible with the SDK's VprojToMake tool. A third-party update adding support is available.

See also