Search code examples
visual-studio-2008msbuildvisual-studio-express

DirectX SDK include/librarie folders via MSBuild and Visual Studio Express 2008: missing


I've come across a strange thing.

Visual Studio 2008 Project: Include/Libraries folder of the DirectX SDK have been added via Tools->Options->Projects and Solutions->VC++ Directories.

The required include file dsound.h from the DirectX SDK is correctly referenced.

Compilation and linking works fine

  • via Visual Studio 2008
  • also via MSBuild using Visual Studio 2008 from the VS command line

Now on another machine, running Visual C++ 2008 Express with the same settings...

Compilation and linking works fine

  • via Visual C++ 2008 Express

But via MSBuild from the VS Express cmd line, the include path to the DirectX SDK is missing and the compilation of course fails.

Could this be a problem of the Express edition? How would you work around it, without adding the per-machine related include path to the project itself?


Solution

  • I was unable to find a global config file for MSBuild 2008, where some global compiler paths could be added.

    However, you can add the paths to the include and library lists of the project from Visual Studio GUI. They get stored in the vcproj file, and used by MSBuild.

    In my case I simply added this to the respective project directories:

    $(DXSDK_DIR)\Include
    $(DXSDK_DIR)\Lib\x86
    

    Then you can call MSBuild as usual:

    MSBuild.exe /nologo /v:minimal /p:Configuration=Debug