Compile OpenBOR engine on Windows

gzuk

New member
Hi, I'm a newbie to compiling stuff on Windows, and I couldn't get the OpenBOR setup to work.

I installed Msys64, downloaded the OpenBOR sources, made a build directory, and ran cmake. The output says build files have been written. I thought those files should include a Makefile, but there seems to be none. When I run the build-all.sh instead, I get this error message: "fatal error: SDL.h: No such file or directory"

There is one SDL.h at C:\msys64\mingw64\include\SDL\SDL.h, but I don't know where I could put that filepath.

Is there any tutorial or howto article for compiling OpenBOR with the Windows Msys64 setup, which could tell me the exact commands, and the folders where to execute them?

Thanks in advace!
 
@gzuk not sure about compiling on windows but using cmake you can follow the instructions on compile.md to build the windows port maybe try cygwin or the linux subsystem.
 
For the record, I'm going to fix this, if I have to revert to do. OpenBOR started on DOS, and is a WIndows first application. Compiling on Linux is a "nice to have", not a priority over compiling Windows ON Windows.

DC
 
Thanks for the replies. I had already compiled on Linux for Linux before, and it all went very smooth, and the binaries worked. Windows seems much harder. I'll have a look at the instructions for compiling on Linux for Windows.

If anyone reads this who compiled successfully on Windows, it'd still be cool if you could provide me with the steps. Thanks!
 
Okay, I was now able to compile the OpenBOR Windows executable on Windows, but only by using Visual Studio Code, and by manually adding iOS header paths to CMakeLists.txt. It's probably better than nothing, so I'll share my solution here. It was roughly these steps:
  • Install MSYS with MinGW. Use Pacman to install CMake, SDL, VPX. (Maybe more is needed, I installed a bunch of stuff during trial and error.)
  • Install Visual Studio Code, with Extensions "C/C++" and "CMake Tools", all from Microsoft.
  • Configure C/C++ builds to use the MinGW GCC and G++ compilers.
  • Configure CMake Tools to use the CMake binary of MinGW.
  • Manually add the paths "engine/ios/libraries/SDL/include" and "engine/ios/libraries/VPX.framework/Headers" to CMakeLists.txt.
  • After that, an OpenBOR build started through VS Code succeeded. (Before, the SDL and VPX header files couldn't be found.)
The entries I manually added to CMakeLists.txt, next to the engine/sdl entry, were these:

Code:
target_include_directories(${PROJECT_NAME} PRIVATE
  engine/ios/libraries/SDL/include
)
target_include_directories(${PROJECT_NAME} PRIVATE
  engine/ios/libraries/VPX.framework/Headers
)

That's a newbie hack of course. There should be a way to have CMake pick up the header files from the MSYS/MinGW installations automatically, instead of manually inserting those versions that are meant for the OpenBOR iOS build. There should also be a way to run CMake from the MSYS shell, but for me, it then complained that the GCC compiler couldn't compile the minimal test program. If anyone knows the solutions to those problems, please share.

Anyways, a big thanks to the whole team and all contributors for this great cross-platform engine, which you can actually compile and run on Windows. :)
 
Back
Top Bottom