I'll try and explain as best I can (let me know if something is unclear), I'm in a rush to get home from work so I'm posting this right before I leave.
I spent the whole day today trying to sort out my Dx11 compilation issue.
We have all our 3rdparty libraries in a specific folder outside ogre, meaning it's not installed into 'program files', but a copy of that folder is located in our 3rdparty folder).
I do however also have the platform sdk installed in programfiles - but I do no want to use that I want to use my custom DirectX SDK folder for cmake..
This means I have to point cmake to reflect this, however no matter what I did I could not get it to compile properly after generating the cmake project files.
In the end I discovered that cmake does indeed set the cmake directory for directx like I want, but it also appends
the path to the kit to the solution, and this seems to cause the compilation issues.
Code: Select all
'C:\Program Files (x86)\Windows Kits\8.1\Include\um'
What I wanted was for it not to include the path for the kit, just point directly to my directX 3rdparty folder when I override it in cmake.
So, if I do this with cmake:
Code: Select all
-DDirectX11_INCLUDE_DIR="D:/SimulationHIL/Products/myproject/Source/3rdParty/Microsoft/DirectX SDK/Include"
it still added the search path:
Code: Select all
'C:\Program Files (x86)\Windows Kits\8.1\Include\um'
This then gave a ton of error messages like this during compilation:
Code: Select all
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\ole2.h(221): error C2370: 'HOLEMENU' : redefinition; different storage class (D:\development\Ogre21\ogre\RenderSystems\Direct3D11\src\OgreD3D11EngineDll.cpp)
9> c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\oleidl.h(2335) : see declaration of 'HOLEMENU'
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\ole2.h(221): fatal error C1003: error count exceeds 100; stopping compilation (D:\development\Ogre21\ogre\RenderSystems\Direct3D11\src\OgreD3D11EngineDll.cpp)
So, what I had to do now as a workaround was to manually remove that include in the project inside visualstudio.
(right click the 'RenderSystem_Direct3D11' and remove the path to the kit).
Then I was able to compile and run some dx11 samples.
So - if you override the directx search directory - It seems to me as if it should not append the 'kit' to the include path in the project.
I do not have access to windows at home (only use linux there), so if more information is needed I can provide that tomorrow morning.