syntax error: identifier 'DXGI_RGBA in file dxgi1_2.h

送分小仙女□ 提交于 2019-12-06 05:03:56

More than likely you are mixing the legacy DirectX SDK headers with the Windows 8.x SDK headers and mixing the old DXGI headers with new ones. As detailed on MSDN, if you want to mix the old DirectX SDK with the Windows 8.x SDK, you need to invert the traditional include path order.

Don't use this:

<IncludePath>$(DXSDK_DIR)Include$(IncludePath);</IncludePath>
<LibraryPath>$(DXSDK_DIR)Lib\x86$(LibraryPath);</LibraryPath>
<LibraryPath>$(DXSDK_DIR)Lib\x64;$(LibraryPath);</LibraryPath>

Use this:

<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>

There are also some #include tricks if you are using older stuff like D3DX headers which can implicitly pick up the old headers.

Ideally you should remove all use of the legacy DirectX SDK paths, but if you want to use XAudio on Windows 7 you need to continue to use it. See the wiki for details.

you can probably try to #include "SpriteFont.h" in your .cpp file instead of your .h header file. I solved this problem in this way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!