简体   繁体   中英

Redefinitions when #include-ing DirectXMath and DirectXTex

Using VS2018Pro, Windows10,

I'm getting many redefinition compilation errors when pulling in DirectXTex.h, DirectXMath.h and DirectXCollision.h across project files.

DirectXMath and DirectXCollision are part of the Win10SDK headers and I pulled DirectXTex from the github repo and put it local to my project folder.

In my code base I need to include the DirectXTex.h, DirectXMath.h and DirectXCollision.h headers across various files however I'm getting many redefintion errors and duplicates that are within the DirectX namespace. I understand that I may have to include one before the other (which I've tried many variations of, and DirectXTex pulls in DirectXMath for eg) but I can't get things to compile.

Does anyone have a clue as to the correct order of pulling in these includes across project files?

解决方案是将所有“ #include DirectX * .h”标头从项目标头文件移到cpp文件中。

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