Mingw64 Build Fails (Windows port requires DirectInput (not found))
saboot

I've followed the installation instructions here
https://wiki.allegro.cc/index.php?title=Building_with_msys2
accurately using MSYS2 with the mingw64 toolchain

Unfortunately the setup fails during the CMake step

$ cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw64/x64_64-w64-mingw32 -DWANT_MONOLITH=on ../../src/allegro5/
...
-- Performing Test ALLEGRO_HAVE_PROCFS_ARGCV
-- Performing Test ALLEGRO_HAVE_PROCFS_ARGCV - Failed
-- Performing Test ALLEGRO_HAVE_SV_PROCFS_H
-- Performing Test ALLEGRO_HAVE_SV_PROCFS_H - Failed
-- Performing Test ALLEGRO_HAVE_VA_COPY
-- Performing Test ALLEGRO_HAVE_VA_COPY - Success
-- Found OpenGL: opengl32
S3TC locking disabled. You will not be able to load/save pre-compressed textures with OpenGL.
-- Could NOT find DINPUT (missing:  DINPUT_INCLUDE_DIR)
-- Could NOT find D3D9 (missing:  D3D9_INCLUDE_DIR)
-- Could NOT find D3DX9 (missing:  D3DX9_INCLUDE_DIR D3DX9_LIBRARY)
-- Could NOT find DSOUND (missing:  DSOUND_INCLUDE_DIR)
-- Could NOT find XINPUT (missing:  XINPUT_INCLUDE_DIR XINPUT_LIBRARY)
CMake Error at CMakeLists.txt:691 (message):
  Windows port requires DirectInput (not found).


-- Configuring incomplete, errors occurred!
See also "C:/msys64/home/Aaron/.local/build/allegro-build/CMakeFiles/CMakeOutput.log".
See also "C:/msys64/home/Aaron/.local/build/allegro-build/CMakeFiles/CMakeError.log".

Not entirely sure what's going on there. Should I have some X11 headers? Or should mingw installs be using directx? Though that doesnt sound right.

Any help appreciated, thank you

SiegeLord

Try doing just cmake -G"MSYS Makefiles" ../../src/allegro5. This just worked for me with mingw-w64. I think the install prefix is confusing it (it was at some point necessary, but I guess no more?).

saboot

Hmm, I get the same errors when not using the CMAKE_INSTALL_PREFIX and/or WANT_MONOLITH

I looked and confirmed that dinput.h is in C:\msys64\mingw64\x86_64-w64-mingw32\include and libdinput.a is in C:\msys64\mingw64\x86_64-w64-mingw32\lib

I guess CMake just isn't finding them, not sure why.

I installed qt5 to get the msys2 cmake-gui working, after running it seems that cmake is hooking onto the native windows libraries (shown in attachment).

My PATH variable is : PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Program Files/ImageMagick-6.9.3-Q16:/c/Program Files/ImageMagick-6.9.2-Q16:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Cuminas/Document Express DjVu Plug-in:/c/Program Files (x86)/Intel/iCLS Client:<...more windows paths>

EDIT: I got it working by manually specifying the cmake paths for the missing libraries. I think CMake is looking at the windows locations before the mingw. Can probably just add C:\msys64\mingw64\x86_64-w64-mingw32\ to the path and it will be fine. My changes in the cmake gui are attached

Thread #616126. Printed from Allegro.cc