OpenD2 icon indicating copy to clipboard operation
OpenD2 copied to clipboard

Unable to compile on Linux

Open KevinTyrrell opened this issue 6 years ago • 2 comments

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.

KevinTyrrell avatar Feb 28 '19 11:02 KevinTyrrell

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

Lectem avatar Feb 28 '19 21:02 Lectem

It also says snprintf not defined and that it's defined in cstdio.

kermitdafrog8 avatar May 29 '21 02:05 kermitdafrog8