<< CMake: Copy files after build | Home | Found my baby, Wood Games 3D >>

Cross-Compiling with mingw: "mingw mutex is not a member of std"

Using spdlog as logger in my current project gives me an error when I try to cross compile it using my urho3d-docker-setup:

error: 'mutex' is not a member of 'std'

After asking the internet I found out that there are actually different mingw-compilers with different suffixes:

x86_64-w64-mingw32-gcc-win32
x86_64-w64-mingw32-gcc-posix

Where the upper seems not to work with mutex. (Actually strange, I compiled lots of stuff with Urho3d and its dependencies and I would have guess those would use at some point a mutex!?)

In the end I got everything compiled using the compiler with -posix suffix. (I altered the urho3d's mingw toolchain-file...)

If you want to see all possible "alternatives" of this gcc/g++ command you can do it like this:

update-alternatives --display x86_64-w64-mingw32-g++

And you can choose one in some kind of interactive mode:

update-alternatives --config x86_64-w64-mingw32-g++

You can also set it directly like this:

update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix # posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-win32 # win32

Ref:

Home