Enabling threading support for MinGW w64 cross compiler

EDIT: I've noticed there isn't a bits folder in my include directory, which is bugging me. Maybe it has to do with that? That's where std_mutex.h is supposed to be, and that's the file that declared the mutex class after all.

I've been trying to cross compile SFNUL for some time because I'm coding a game and will be distributing for Windows. I have the mingw-w64 package installed, and have already compiled some libraries and there have been no problems.

That isn't the same for SFNUL though. SFNUL uses threading, and one of its dependencies, namely botan, needs a mutex object.

When I try make the SFNUL library, I get the following error.

[  0%] Building CXX object CMakeFiles/sfnul.dir/extlibs/botan/src/lib/algo_base/scan_name.cpp.obj In file included from /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:8:0: /home/chemicalchems/SFNUL/extlibs/botan/include/botan/scan_name.h:97:19: error: ‘mutex’ in namespace ‘std’ does not name a type        static std::mutex s_alias_map_mutex;                    ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:65:6: error: ‘mutex’ in namespace ‘std’ does not name a type  std::mutex SCAN_Name::s_alias_map_mutex;       ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp: In static member function ‘static void Botan::SCAN_Name::add_alias(const string&, const string&)’: /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:178:20: error: ‘mutex’ is not a member of ‘std’     std::lock_guard<std::mutex> lock(s_alias_map_mutex);                     ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:178:20: error: ‘mutex’ is not a member of ‘std’ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:178:30: error: template argument 1 is invalid     std::lock_guard<std::mutex> lock(s_alias_map_mutex);                               ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:178:37: error: ‘s_alias_map_mutex’ was not declared in this scope     std::lock_guard<std::mutex> lock(s_alias_map_mutex);                                      ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp: In static member function ‘static std::__cxx11::string Botan::SCAN_Name::deref_alias(const string&)’: /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:186:20: error: ‘mutex’ is not a member of ‘std’     std::lock_guard<std::mutex> lock(s_alias_map_mutex);                     ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:186:20: error: ‘mutex’ is not a member of ‘std’ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:186:30: error: template argument 1 is invalid     std::lock_guard<std::mutex> lock(s_alias_map_mutex);                               ^ /home/chemicalchems/SFNUL/extlibs/botan/src/lib/algo_base/scan_name.cpp:186:37: error: ‘s_alias_map_mutex’ was not declared in this scope     std::lock_guard<std::mutex> lock(s_alias_map_mutex);                                      ^ CMakeFiles/sfnul.dir/build.make:88: recipe for target 'CMakeFiles/sfnul.dir/extlibs/botan/src/lib/algo_base/scan_name.cpp.obj' failed make[2]: *** [CMakeFiles/sfnul.dir/extlibs/botan/src/lib/algo_base/scan_name.cpp.obj] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/sfnul.dir/all' failed make[1]: *** [CMakeFiles/sfnul.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 

It's a pretty straight forward error, but I can't seem to find a solution that helps me at all.


What I have tried

The problem I think is not that I don't have the pthread dll, because I have it in the lib directory, like it should be, but rather that std::mutex (and possible std::thread) aren't even declared. The files are in the include directory, but I've heard something about GTHREADS not being declared.

If any more information is necessary, please ask for it. Thank you very much in advanced.

Replay

Category: g++ Time: 2016-07-31 Views: 2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.267 (s). 12 q(s)