I'm attempting to get a Qt application to build from the command line under linux targetted for windows. I've used mxe to build a toolchain for targetting windows but my build fails whinging about various thread related bits. mxe built with winpthreads and I know the Qt project will build on windows itself from inside of creator, using the pre-packaged mingw compiler. I'm successfully building using my ARM Linux cross compiler, so I just want to get windows done the same. I'm trying to get a one line build on a build server or from Jenkins for all my targets.
I'm guessing I'm missing something that I need to pass to mxe when doing the cross toolchain build or alternatively missing something I need to pass to qmake for this build to succeed.
The issue is with the default MXE build of GCC using win32 threads as opposed to mingws pthreads implementation.
Edit src/gcc.mk and ensure that winpthreads is added to the $(PKG)_DEPS list and then change the configure line so that --enable-threads=win32 becomes --enable-threads=posix.
Then re-make winpthreads and gcc. Note that there is a circular dependency here, you need to build gcc with win32 threads (the default) first THEN remake with winpthreads.
Thanks to Andreia Gaita for this - http://blog.worldofcoding.com/2014/05/cross-compiling-c11-without-going-madder.html