Setting up the DirectX SDK with Visual Studio 2010


So I had a bit of time this morning and finally upgraded to visual studio 2010. There are a lot of changes but I am really enjoying it. It is a definite improvement over VS2008, some features that I have been begging for for years are finally in and the interface has been cleaned up significantly.

The new help system takes a bit of getting used to but it is only the first version and they promised that some massive improvements are coming.

Now Getting DX integrated with VS2010 was a bit tricky as the installer doesn’t automatically as the SDK include and lib folders to the default include/lib folders as it did in VS 2008, and it requires a bit of fiddling.

Setting up the Include and Library Paths

They removed the global VC path system accessible through the options dialog and have opted for a per-project path system with several global user files. This mean that for every single project that you make that uses the DX API you will need to add in the DX SDK directories manually via the project properties -> VC++ Directories (I’d personally recommend this technique since it allows projects to be more portable) but if you are lazy, you can add the SDK paths to the default c++ project settings template stored in the glocal cpp user file. This is done as follows:

Step 1: Open up the “Property Manager” under the “View” menu.

Step2: Expand the project/configurations tree and select the “Microsoft.Cpp.X.user” user file. Right click and select “Properties”.

Step3: Add the DX SDK include and Lib folders to the appropriate VC++ directories. Use the $(DXSDK_DIR) macro to future proof the setting. Click Ok, then exit VS2010, you will be prompted to save the user file, click yes and from now on the DXSDK folders will be set for any future C++ projects!

Linking the DirectX Static Libraries In Your Projects

Step1: Select the project properties from the project menu.

Step2: Expand the “Linker” section and select “Input” and under “Additional Dependencies” add the necessary lib files (D3D10.lib & D3DX10.lib).

NOTE: Make sure you select “All Configurations” from the drop down list in the top left hand corner, otherwise the lib files will only be loaded for the currently selected configuration.

And thats all there is to it! Now you will be able to include any directX headers without any problems (just remember to include the library files under the linker input for extra headers like DXGI)

24 thoughts on “Setting up the DirectX SDK with Visual Studio 2010

  1. Pingback: See Also:
  2. yeah, well, ive checked everywhere on my project properties. The linker section does not exist on it anywhere. Why can i not see it?

  3. make sure that you have at least one cpp file in the project before trying to set the linker options. They dont appear until you do.

  4. Pingback: - « Phoenix
  5. Thank You very much.
    I cannot just set include and lib directories via properties for about 80 of ClanLib examples.
    I must make it globally.

  6. After setting up it and follow every single step, I still have the error/s:

    error C2061: syntax error : identifier ‘__RPC__out_xcount_part’
    error C2059: syntax error : ‘)’
    fatal error C1903: unable to recover from previous error(s); stopping compilation

    and so on

    Any help??

  7. Thanks great work sir.
    I’m a Newbie, follow all steps u suggest, when run, it shows an error.
    With heading “xxxxx.exe – Application Error”
    and content “The application was unable to start correctly (0xc000007b).Click OK to close the application.”
    Please help me….
    Thanks in advance!

  8. fantastic publish, very informative. I ponder why the opposite experts of this sector don’t understand this. You must continue your writing. I’m sure, you have a huge readers’ base already!

  9. Great post. I was checking constantly this blog and I am impressed!

    Very useful information specially the last part:)
    I care for such info much. I was seeking this
    certain information for a very long time. Thank you and
    good luck.

  10. Thank you Mr Bobby for this great masterpiece. Am personally interested in being a prolific game programmer, computer graphics and networking. However Am requesting you to help and tell me some of the pre-requisite IDEs that need to be installed before installing DirectX and the possible sites were I can get them. Thank you so much

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s