Thread: Using DirectX with MSVC 2010

  1. #1
    Registered User gavra's Avatar
    Join Date
    Jun 2008
    Posts
    265

    Using DirectX with MSVC 2010

    Hi,
    I'm having trouble trying to compile my project using MSVC 2010 (which was compiled successfully about 2 years ago).

    Code:
    #include <d3d9.h>
    #include <D3dx9core.h>
    
    #pragma comment(lib, "d3d9.lib")
    #pragma comment(lib, "D3dx9.lib")
    #pragma comment(lib, "Winmm.lib")
    It can't find D3dx9core.h even though I installed DXSDK_Mar09 after installing msvc 2010 while it wasn't open.
    I tried adding it manually, but no success. Google didn't help o:

    Maybe it's because I'm having another version of directX runtime installed.

    Anyone? Please?
    Thank you (:
    gavra.

  2. #2
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    Did you add the SDK's include folder to the search path? I don't think the installer does it automatically, or at least it never did for me.
    Also make sure that the library path is correct.

    Project properties -> Configuration Properties -> VC++ Directories

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I do not think you need to include that header. You should only need to include d3d9.h and d3dx9.h. Those will include the appropriate headers for you.

  4. #4
    Registered User gavra's Avatar
    Join Date
    Jun 2008
    Posts
    265
    ok I had a mistake in the include and lib directories that lead to a linker error. Google helped this time. Thank you (:
    gavra.

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    That will still not correct the fact that you are including the wrong header. It just tells the compiler where to find the headers. You only need to include d3d9 and d3dx9.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VC++ 2010 Error
    By Arpan Das in forum C++ Programming
    Replies: 12
    Last Post: 06-26-2011, 04:52 AM
  2. 20/10/2010 20:10
    By Salem in forum General Discussions
    Replies: 10
    Last Post: 10-21-2010, 10:46 AM
  3. Windows 7 RC, Visual Studio 2010 Beta, Office 2010 beta, anyone in?
    By indigo0086 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-20-2009, 01:57 PM
  4. Directx and MSVC++
    By HybridM in forum Game Programming
    Replies: 1
    Last Post: 06-26-2003, 09:28 AM
  5. DirectX 8: Creating the DirectX Object
    By Toraton in forum Game Programming
    Replies: 3
    Last Post: 11-28-2002, 03:45 AM