Skip to content

Build on Windows with MSYS2

Jakob Flierl edited this page Jul 8, 2023 · 26 revisions

Install MSYS2 from https://www.msys2.org/ . See https://gist.github.com/Bluexin/1c58d9b6d707f755b66a94314e3dfd32

Next, run:

pacman -Syu
pacman -S --needed mingw-w64-x86_64-github-cli git
pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-qt-creator
pacman -S --needed mingw-w64-x86_64-qt5 mingw-w64-x86_64-assimp mingw-w64-x86_64-freeglut
pacman -S --needed mingw-w64-x86_64-glew mingw-w64-x86_64-SDL2
pacman -S --needed mingw-w64-x86_64-boost mingw-w64-x86_64-lua51 unzip
pacman -S --needed mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
pacman -S --needed mingw-w64-x86_64-qscintilla
pacman -S --needed mingw-w64-x86_64-bullet

Run "MSYS MinGW 64-bit" from Start menu

Download and compile luabind fork:

cd
git clone https://github.com/bullet-physics-playground/luabind
cd luabind && mkdir build && cd build
cmake ..
ninja

Download and compile libQGlViewer:

cd
git clone https://github.com/GillesDebunne/libQGLViewer.git
cd libQGLViewer
cd QGLViewer
qmake
make

Download and compile bpp:

cd
git clone https://github.com/bullet-physics-playground/bpp
cd bpp

In bpp.pro replace two lines as shown in the following diff:

index e5f5300..05f0c98 100755
--- a/bpp.pro
+++ b/bpp.pro
@@ -19,11 +19,11 @@ QMAKE_CXXFLAGS += -Wno-attributes -Wno-deprecated -Wno-deprecated-copy -Wno-depr

 win32 {

-#  CONFIG += build_with_msys2
-#  include(msys2.pri)
+  CONFIG += build_with_msys2
+  include(msys2.pri)

-  CONFIG += build_with_mxe
-  include(mxe.pri)
+#  CONFIG += build_with_mxe
+#  include(mxe.pri)

   RESOURCES   += res.qrc humanity.qrc

Next build bpp:

qmake
make

And run bpp:

./release/bpp.exe

WIP (work in progress): TODO figure out howto deploy the app (copy dlls and plugins).