d3dx11.h missing?

后端 未结 3 502
一整个雨季
一整个雨季 2020-12-24 13:25

So I\'ve reinstalled directx11 a couple times and even went to the Microsoft website and got the SDK pack that has all the direct x cabinet files in it. Anyone have any idea

3条回答
  •  遥遥无期
    2020-12-24 13:56

    That's what you need to do in VS 2010 (it looks a bit different in VS 2008 and earlier):

    Go to your project's properties | Configuration Properties | VC++ Directories. Edit line called Include Directories by adding path to DirectX header files. As for June 2010 SDK it may be something like:

    32 bit Win: C:\Program Files\Microsoft DirectX SDK (June 2010)\Include

    64 bit Win: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include

    Next you are most likely to get a linker's error (missing .lib files). Just go to your project's properties | Configuration Properties | VC++ Directories again, but this time edit Library Directories and add to one of the following paths:

    32 bit Win: C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86

    64 bit Win: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64

    If you installed other version of SDK or installed it to non-default directory change given paths accordingly. Also make sure you added d3d11.lib (and maybe d3dx11.lib as well) to Linker | Additional Dependencies.

    General rule is that any time you #include <> files your IDE needs to know where to find them. VC++ Directories is one way of doing that in Visual Studio. But sole inclusion of headers is (in most cases) not enough - you need to tell your linker where to look for precompiled binaries described by those headers. That what you do by adding the second path to Library Directories.

提交回复
热议问题