Closed dragon99919 closed 1 week ago
Hello. SDL2 is used only in the Linux version. When compiling a game for Windows, WinAPI is used. It is required to rewrite CMakeLists.txt for the use MinGW. You may also need a definition in the Engine code. Libraries EntitiesMP and GameMP should be compiled without problems.
I once didn’t bother to write for the MinGW , because projects GameGUIMP , EngineGui, SeriousSkaStudio, Modeler and WorldEditor contain MFC.
It will take a lot of work. It's easier to compile on a virtual machine using Windows. And one of the problems of the engine is that the network code will be incompatible between Windows and Linux https://github.com/tx00100xt/SeriousSamClassic-VK/issues/18
Understandable, well, time to set up a VM, cheers. ; )
Hey! I've been trying to make a project that can natively run in both Linux and Windows, and while compiling Linux version on Linux host goes just fine, when trying to use mingw-w64-x86_64 the CMake screams about SDL2 not being found:
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) cmake/FindSDL2.cmake:164 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:46 (find_package)
Any idea if this is fixable under Linux, or do Windows binaries will have to be compiled via VM (trying to not resort to that)?
If it helps anyhow, I was using a script for CMake found in some other repo that was said would work to compile Windows apps under Linux:
set(CMAKE_SYSTEM_NAME Windows) set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)