Search code examples
qtcmakemingwcodeblocksmingw-w64

Building Qt application MARSYAS with CodeBlocks & CMake on Windows 10


I've been trying to build the MARSYAS application on Windows 10 with these instructions. However, my IDE of choice is usually CodeBlocks instead of Visual Studio and I would like to use that instead of it. I also use MinGW instead of a Microsoft compiler. I would also like to use that as a build system.

When I use cmake-gui in the Marsyas source code directory, I can configure and generate a CodeBlocks project with MinGW makefiles. In the process I have to add the entry CMAKE_PREFIX_PATH with the Qt source code. Now, herein lies the problem. I can chose the source code for multiple runtimes inside of the Qt\5.11.1 directory. But no matter to which one I set CMAKE_PREFIX_PATH (mingw53_32, msvc2015, etc. ), the build inside of the generated CodeBlocks project always fails with the following error:

marsyas-release-0.5\src\marsyas\marsystems\AudioSource.h|74|error: 'mutex' in namespace 'std' does not name a type|
marsyas-release-0.5\src\marsyas\marsystems\AudioSource.h|75|error: 'condition_variable' in namespace 'std' does not name a type|
marsyas-release-0.5\src\marsyas\marsystems\AudioSink.h|70|error: 'mutex' in namespace 'std' does not name a type|
marsyas-release-0.5\src\marsyas\marsystems\AudioSink.h|71|error: 'condition_variable' in namespace 'std' does not name a type|

I've tried applying the recommendations in this StackOverflow question: installing the mingw32-pthreads- packages in the MinGW installation manager and installing MinGW-W64, but to no avail so far.

Is there anyone who could offer me some advice? It would be much appreciated!

Thanks in advance, Joshua


Solution

  • I have kind of fixed my problem. You cannot compile a C++ project using the C++ 11 threading API with a MinGW compiler ( not even MinGW-W64 ) since those depend on the UNIX pthread library to provide the runtime functionality for that API. But, unfortunately, there seem to be many problems with the pthread package made for Windows. No matter what I did, I could not build successfully with CodeBlocks.

    I build the project with Microsoft Visual Studio, making sure to select the Release goal in the toolbar and enabling the install target in Build > Configuration Manager. Now, I have MARSYAS built with a Microsoft Visual C++ runtime. I hope that in the future building it on Windows with a GNU runtime will work, but for now I don't see other options ...