OpenD2
OpenD2 copied to clipboard
Unable to compile on Linux
OpenD2-EXEReplacement/Game/Platform_Windows.cpp:3:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
CMakeFiles/game.dir/build.make:62: recipe for target 'CMakeFiles/game.dir/Game/Platform_Windows.cpp.o' failed
make[2]: *** [CMakeFiles/game.dir/Game/Platform_Windows.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/game.dir/all' failed
make[1]: *** [CMakeFiles/game.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Linux does not support libraries such as <Windows.h>. I downloaded the .tar.gz link in the latest release but it still contained windows-specific libraries. This will make it impossible to compile on linux.
This is not expected, the CMakelists.txt should not le you compile Platform_Window.cpp. I think instead of removing files from the list, you should be adding them based on the platform to avoid such issues https://github.com/eezstreet/OpenD2/blob/6e04011d00a8a0ed04e74968696ec300454d4346/CMakeLists.txt#L30
It also says snprintf not defined and that it's defined in cstdio.