wgois / OIS

Official OIS repository. Object oriented Input System
https://wgois.github.io/OIS/
zlib License
254 stars 87 forks source link

Can't configure project with CMAKE [DirectX SDK error] #41

Closed lapinott closed 6 years ago

lapinott commented 6 years ago

CMAKE says it can't find the DirectX SDK - I am using windows 10 and the SDK is supposedly already a part of Windows or am I wrong?

CMAKE output:

Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299.
The C compiler identification is MSVC 19.14.26428.1
The CXX compiler identification is MSVC 19.14.26428.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:68 (MESSAGE):
  Could not locate DirectX SDK on this system

Configuring incomplete, errors occurred!
See also "C:/Users/Julien/source/repos/NYNE/OGRE/OIS-build/CMakeFiles/CMakeOutput.log".
Ybalrid commented 6 years ago

This is strange. Can you check if you have the Windows SDK installed?

If so, you should see stuff in the C:\Program Files (x86)\Windows Kits\10\bin directory, with the version that are installed.

Alternatively, you can download a standalone DirectX SDK from Microsoft here, it does actually work on Windows 10, and install the correct libraries where the FindDirectX CMake script expect them to be:

https://www.microsoft.com/en-us/download/details.aspx?id=6812

You need torelaunch CMake GUI if you use it after installing one of these, because they change some environment variable during the process.

lapinott commented 6 years ago

This is strange. Can you check if you have the Windows SDK installed?

If so, you should see stuff in the C:\Program Files (x86)\Windows Kits\10\bin directory, with the version that are installed.

Yes I have all the necessary files in there. It just seem to me the CMAKE process is too stupid to figure out where to look ? I have all the binaries in there (C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0), for arm, arm64, x64, x86.

Ybalrid commented 6 years ago

It seems to be able to find the SDK installed by the thing I liked to you. I agree that this is strange. I need to dig a bit deeper into DirectX.

Can you please try installing the file linked in my last message? It shouldn't interfere with anything that was automatically installed by Visual Studio as it does it in a different folder.

lapinott commented 6 years ago

1.4 Release: 1>d:\jumat\downloads\ois-1.4\ois-1.4\includes\win32\win32keyboard.h(54): error C4716: 'OIS::Win32Keyboard::getAsKeyCode' : doit retourner une valeur

Will try from latest commit.

lapinott commented 6 years ago

OK here is what I had to do.

First download OIS not from releases but from latest commit.

On Windows 10 the path to DXSDK has a different pattern. On my system the full path is (for x64 libs)

D:\Windows Kits\10\Lib\10.0.17134.0\um\x64

I modified the CMakeLists.txt line 142 to

target_link_libraries(OIS "${DXSDK_DIR}/um/${DIRECTX_ARCH}/dinput8.lib" "${DXSDK_DIR}/um/${DIRECTX_ARCH}/dxguid.lib")

So for a CMAKE run you would put D:\Windows Kits\10\Lib\10.0.17134.0 as DXSDK_DIR.

Just another minor inconvenience: when building the INSTALL target for debug and release, the release dll will overwrite the debug one (same name).

Hope it helps.

Ybalrid commented 6 years ago

Yeah the release as been tagged after the fact and it was the de-facto version of some linux package. Right now you would want to get the lattest commit...

I will look into how the CMakeLists file actually look for DirectX. It seems to be cobbled together as not done properly. Thanks for the feedback! ;-)

Le 25 mai 2018 à 06:16, Julien Matthey notifications@github.com a écrit :

Closed #41.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.