C++ C++;编译错误,std中的互斥体未在MinGW中命名类型(GCC 6.3.0)

C++ C++;编译错误,std中的互斥体未在MinGW中命名类型(GCC 6.3.0),c++,mongodb,c++11,gcc,mingw,C++,Mongodb,C++11,Gcc,Mingw,我正在尝试在Windows1064bit上用MinGW(G++6.3.0)编译MongoC++11驱动程序。来自GCC 6发行说明 默认模式已更改为-std=gnu++14 我的理解是默认情况下也支持C++11。 为什么我会收到这些关于互斥和线程的错误消息 from F:/Projects/Mongo/attempt_4_mingw64/mongo-cxx-driver-r3.1.1/src/mongocxx/exception/private/mongoc_error.hh:19, from

我正在尝试在Windows1064bit上用MinGW(G++6.3.0)编译MongoC++11驱动程序。来自GCC 6发行说明

默认模式已更改为-std=gnu++14

我的理解是默认情况下也支持C++11。 为什么我会收到这些关于互斥和线程的错误消息

from F:/Projects/Mongo/attempt_4_mingw64/mongo-cxx-driver-r3.1.1/src/mongocxx/exception/private/mongoc_error.hh:19,
from F:\Projects\Mongo\attempt_4_mingw64\mongo-cxx-driver-r3.1.1\src\mongocxx\bulk_write.cpp:20:
F:/Projects/Mongo/attempt_4_mingw64/mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:183:10: error: 'mutex' in namespace 'std' does not name a type
         std::mutex _active_instances_lock;
              ^~~~~
F:/Projects/Mongo/attempt_4_mingw64/mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:184:24: error: 'thread' is not a member of 'std'
         std::unordered_map<std::thread::id, instance*> _active_instances;
                            ^~~
F:/Projects/Mongo/attempt_4_mingw64/mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:184:24: error: 'thread' is not a member of 'std'
F:/Projects/Mongo/attempt_4_mingw64/mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:184:50: error: wrong number of template arguments (1, should be at least 2) 
         std::unordered_map<std::thread::id, instance*> _active_instances;
                                                      ^
from F:/Projects/Mongo/trust\u 4\u mingw64/Mongo-cxx-driver-r3.1.1/src/mongocxx/exception/private/mongoc\u error.hh:19,
来自F:\Projects\Mongo\trunt\u 4\u mingw64\Mongo-cxx-driver-r3.1.1\src\mongocxx\bulk\u write.cpp:20:
F:/Projects/Mongo/trust\u 4\u mingw64/Mongo-cxx-driver-r3.1.1/src/mongocxx/test\u util/mock.hh:183:10:错误:命名空间“std”中的“mutex”未命名类型
std::mutex\u active\u instances\u lock;
^~~~~
F:/Projects/Mongo/trunt_4_mingw64/Mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:184:24:错误:“线程”不是“std”的成员
std::无序的\u映射\u活动\u实例;
^~~
F:/Projects/Mongo/trunt_4_mingw64/Mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:184:24:错误:“线程”不是“std”的成员
F:/Projects/Mongo/trunt_4_mingw64/Mongo-cxx-driver-r3.1.1/src/mongocxx/test_util/mock.hh:184:50:错误:模板参数数量错误(1,应至少为2)
std::无序的\u映射\u活动\u实例;
^

mongocxx当前,因此无法使用MinGW进行构建。也就是说,如果您还没有,我建议在您的CMAKE_CXX_标志中传递
-std=c++11
,看看这是否有效。

您是否正在运行一个生成系统,该系统允许您查看执行的命令?哪些标志传递给编译器?你也能展示一下吗?使用的编译器真的是你所期望的吗?@Someprogrammerdude,我使用的是CMake 3.8,它提供了这种输出
——检查CXX编译器是否正常工作:C:/MinGW64/bin/g++.exe——工作
。因此,可以肯定的是,它使用的是G++并且我仅有的版本是6.3.0。如果您运行
makeverbose=1
,那么您将看到传递给编译器的标志。是否将类似于
-std=c++03的内容(或类似内容)传递给编译器?请参阅