Cross-building (MinGW) on Linux
darealshinji opened this issue · 1 comments
darealshinji commented
I was using MXE to build the MinGW compiler on Linux (GCC 5.4.0) and tried to cross-build Dagon on Linux. But it fails at Audio.cpp:
$ make verbose=1 CC=i686-w64-mingw32.static-gcc CXX=i686-w64-mingw32.static-g++ AR=i686-w64-mingw32.static-ar WINDRES=i686-w64-mingw32.static-windres
==== Building Dagon (debug) ====
Creating objs/debug
mkdir -p objs/debug
dirent.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/dirent.o" -MF objs/debug/dirent.d -c "../src/dirent.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
DustData.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/DustData.o" -MF objs/debug/DustData.d -c "../src/DustData.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
FontData.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/FontData.o" -MF objs/debug/FontData.d -c "../src/FontData.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
ShaderData.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/ShaderData.o" -MF objs/debug/ShaderData.d -c "../src/ShaderData.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
siphash24.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/siphash24.o" -MF objs/debug/siphash24.d -c "../src/siphash24.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
SplashData.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/SplashData.o" -MF objs/debug/SplashData.d -c "../src/SplashData.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
stb_image.c
i686-w64-mingw32.static-gcc -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/stb_image.o" -MF objs/debug/stb_image.d -c "../src/stb_image.c"
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
Audio.cpp
i686-w64-mingw32.static-g++ -MMD -MP -D_DEBUG -DDEBUG -DGLEW_STATIC -DOV_EXCLUDE_STATIC_CALLBACKS -I../extlibs/headers -I../extlibs/headers/libfreetype/windows -I../extlibs/headers/libfreetype/windows/freetype -I../extlibs/headers/libsdl2/windows -I../extlibs/headers/dirent -std=c++11 -g -Wall -o "objs/debug/Audio.o" -MF objs/debug/Audio.d -c "../src/Audio.cpp"
In file included from ../src/AudioAsset.h:17:0,
from ../src/Audio.h:39,
from ../src/Audio.cpp:22:
../src/Asset.h:48:8: error: 'mutex' in namespace 'std' does not name a type
std::mutex _loadMutex;
^
../src/Asset.h: In member function 'void dagon::Asset::load()':
../src/Asset.h:38:5: error: '_loadMutex' was not declared in this scope
_loadMutex.lock();
^
Dagon.make:201: recipe for target 'objs/debug/Audio.o' failed
make[1]: *** [objs/debug/Audio.o] Error 1
Makefile:16: recipe for target 'Dagon' failed
make: *** [Dagon] Error 2
Building on Windows with MinGW works fine though.
darealshinji commented
Adding MXE_GCC_THREADS = posix
to settings.mk
does the trick.