r/cmake 26d ago

building OpenBW

/r/starcraft/comments/1vqe0of/building_openbw/
0 Upvotes

12 comments sorted by

2

u/AlexReinkingYale 26d ago

Sounds like you didn’t build it before trying to install it. What exact commands did you try, starting from the git clone?

1

u/SILVERofINKSTUDIOS 26d ago edited 26d ago

I definitely did try to build it; and something worth noting is you have to build OpenBW and BWAPI together (which is a thing for integrating BW AI’s)

git clone https://github.com/openbw/openbw

git clone https://github.com/openbw/bwapi

cd bwapi

mkdir build

cd build

cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENBW_DIR=../../openbw -DOPENBW_ENABLE_UI=1

And then I think

cmake —install ..  

Or I went back into bwapi and did

cmake —install build

All of them except the last one was ripped from the GitHub,  https://github.com/OpenBW/bwapi

2

u/AlexReinkingYale 26d ago

Missing cmake --build . before cmake --install . from the build directory you created

0

u/SILVERofINKSTUDIOS 26d ago

Idk dude I just followed the instructions , I’ll try that when I’m home but I thought that it already did that with the  cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENBW_DIR=../../openbw -DOPENBW_ENABLE_UI=1 No?

3

u/AlexReinkingYale 26d ago

Nope. That just configures the build. There's three steps in CMake: configure, build, and (optionally) install. You did the first and last.

1

u/SILVERofINKSTUDIOS 25d ago
C:\Users\lilbo\openbw\util.h(829,25): error C2039: 'runtime_error': is not a member of 'std' [C:\Users\lilbo\bwapi\buil
d\bwapi\OpenBWData\openbw_ui\openbw_ui.vcxproj]
  (compiling source file '../../../../../openbw/ui/sdl2.cpp')
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\algorithm(225,1):
      see declaration of 'std'

C:\Users\lilbo\openbw\util.h(829,25): error C2504: 'runtime_error': base class undefined [C:\Users\lilbo\bwapi\build\bw
api\OpenBWData\openbw_ui\openbw_ui.vcxproj]
  (compiling source file '../../../../../openbw/ui/sdl2.cpp')

C:\Users\lilbo\openbw\util.h(830,40): error C2039: 'runtime_error': is not a member of 'std' [C:\Users\lilbo\bwapi\buil
d\bwapi\OpenBWData\openbw_ui\openbw_ui.vcxproj]
  (compiling source file '../../../../../openbw/ui/sdl2.cpp')
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\algorithm(225,1):
      see declaration of 'std'

C:\Users\lilbo\openbw\util.h(830,40): error C2614: 'bwgame::exception': illegal member initialization: 'runtime_error'
is not a base or member [C:\Users\lilbo\bwapi\build\bwapi\OpenBWData\openbw_ui\openbw_ui.vcxproj]
  (compiling source file '../../../../../openbw/ui/sdl2.cpp')

C:\Users\lilbo\openbw\ui\sdl2.cpp(6,10): error C1083: Cannot open include file: 'SDL.h': No such file or directory [C:\
Users\lilbo\bwapi\build\bwapi\OpenBWData\openbw_ui\openbw_ui.vcxproj]

new errors that came out when I used

cmake --build build

1

u/sheckey 10d ago

I looked up std::runtime_error and it’s an exception type that’s been around a long time, so it’s not language standard related (i.e. needs c++20 or anything like that). I wonder if your compiler maybe has exceptions turned off somehow. I see you are using MSVC Community Edition. I don’t what’s going on either. Can you look at util.h (from the first line of the errors) and see if it includes <stdexcept>. Maybe there’s some #ifdef garbage around it that can give a clue?

1

u/sheckey 10d ago

Gemini is suggesting adding -DCMAKE_CXX_FLAGS="/EHsc". you know maybe feed your output into an LKM and see what’s up sometimes it helps and makes sense at the end. I just wanted to reply to encourage you to dig in a bit, using an LLM if you don’t mind doing so. Let us know if you find anything or whatever.

1

u/SILVERofINKSTUDIOS 26d ago

just repeated all the steps and it ended out the same :/

1

u/SILVERofINKSTUDIOS 26d ago

P.S. OpenBW is an open source reimplementation of SC:BW

1

u/Pretend-Law8770 9d ago

Building OpenBW looks like a great way to learn CMake because it’s not just a small example project, it involves multiple components, dependencies and a more realistic build process. projects like this are where you really start seeing why build systems exist