C++ cygwin上的gcc 4.7.3是否支持C++;11并发特性?

C++ cygwin上的gcc 4.7.3是否支持C++;11并发特性?,c++,c++11,cygwin,C++,C++11,Cygwin,我正试图在安装了cygwin的64位Windows7机器上编译以下程序,并且 gcc编译器更新为4.7.3: #include <vector> #include <thread> #include <mutex> using namespace std; std::mutex flemutex; std::mutex arrmutex; main() { thread t; } 我得到以下错误: file.cpp:12:1: error: ‘mut

我正试图在安装了cygwin的64位Windows7机器上编译以下程序,并且 gcc编译器更新为4.7.3:

#include <vector>
#include <thread>
#include <mutex>

using namespace std;

std::mutex flemutex;
std::mutex arrmutex;

main() {

thread t;
}
我得到以下错误:

file.cpp:12:1: error: ‘mutex’ in namespace ‘std’ does not name a type
file.cpp:13:1: error: ‘mutex’ in namespace ‘std’ does not name a type
file.cpp: In function ‘int main()’:
file.cpp:39:3: error: ‘thread’ is not a member of ‘std’
file.cpp:39:15: error: expected ‘;’ before ‘t’
有人知道发生了什么事吗


谢谢

您可以尝试以下操作:

#include <thread>
#include <iostream>

using std::cout;
using std::endl;

main() {
#ifndef(_GLIBCXX_HAS_GTHREADS)
  cout << "GThreads are not supported..." << endl;
#endif
}
#包括
#包括
使用std::cout;
使用std::endl;
main(){
#ifndef(_GLIBCXX_有_GTHREADS)

cout(1)您是否尝试将
-lpthread
添加到gcc的命令行?(2)您可以下载MinGW,它不需要cygwin,可以“从框中”使用线程我曾尝试将-lpthread添加到命令行,但没有效果。无论如何,我只是在这里编译,没有链接,所以不会有任何效果,对吗?我也希望这在cygwin上可以工作,而不必在我的机器上安装MinGW。两者可以在同一台机器上和平共存吗?简单-更新cygwin和gcc。谢谢!非常有用普福。
#include <thread>
#include <iostream>

using std::cout;
using std::endl;

main() {
#ifndef(_GLIBCXX_HAS_GTHREADS)
  cout << "GThreads are not supported..." << endl;
#endif
}