简体   繁体   中英

Fatal error C1083 on d3dx9.h after moving to VS2012

I have a Visual C++ project that was working perfectly, until I moved to Visual Studio 2012.

I am using D3DX9, and as such, I am #including d3dx9.h. However, I am getting a fatal error C1083 everywhere I'm including the file that includes d3dx9.h

As I read in this page , the DirectX SDK is now part of the Windows SDK. This seems to be supported by the fact that when I navigate to a file I am not getting an error including, such as d3d9.h, I get sent to some folder inside a folder called "Windows Kits" instead of the DirectX SDK folder.

So I change the include directories setting to

$(IncludePath);C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include

or

C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)

yet the compiler insists on ignoring the DirectX SDK folder, as I still get the C1083 error.

I have no idea what else to try. The files are there, the project builds fine with VS2010, but it's this insistence by the VS2012 compiler that is not letting me go forward.

I also used to be able to see the exact command line sent to the compiler in the build window, but now I can't, so I don't know how to diagnose whether Visual Studio is not sending the correct command line to the compiler, or if the compiler is simply ignoring it.

How do I fix this problem?

Note: The file does exist, and the project does work if I change my #include to

#include "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx9.h"

This is obviously not optimal...

I have discovered a solution if you are still having problems. If you are using the built in "Kits" then you need directives like these in your relevant headers :

#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "DXGI.lib")

There are others you may need depending of what features you are using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM