d3dx11.h missing?

后端 未结 3 489
一整个雨季
一整个雨季 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.

    0 讨论(0)
  • 2020-12-24 14:09

    In my case, for DX12, I was missing d3dx12.h

    See this MSDN page.

    In case the page moves, the relevant line appears to be

    "d3dx12.h is available separately from the Direct3D 12 headers. You can download d3dx12.h by navigating into any of the source files for the Direct3D 12 projects at GitHub/Microsoft/DirectX-Graphics-Samples"

    0 讨论(0)
  • 2020-12-24 14:22

    You have to make sure you get the latest DirectX SDK. It has the header files. If all you got were cabinet files, you got the wrong SDK.

    0 讨论(0)
提交回复
热议问题