我试图编译基于Eclipse开普勒/ MinGW的4.8.1和Win32使用的std ::线程一个简单的C ++程序。 我希望以后在Windows上开发多年的移动发展在某些时候到Linux。
#include "test.h"
#include <thread>
#include <algorithm>
int main()
{
Test::CreateInstance();
std::thread(
[&]()
{
Test::I()->Output2();
}
);
Test::DestroyInstance();
return 0;
}
忽略测试的目的(它只是产生一些输出,我将继续扩充,一旦我得到的std ::线程工作单身!)
我在Eclipse中设置g ++编译器设置:
-c -fmessage-length=0 -std=c++0x -Wc++0x-compat
我已经定义了预处理符号是:
__GXX_EXPERIMENTAL_CXX0X__
建筑抱怨的std ::线程不是性病的成员:
10:30:13 **** Incremental Build of configuration Debug for project test ****
Info: Internal Builder is used for build
g++ -D__GXX_EXPERIMENTAL_CXX0X__ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -Wc++0x-compat -o main.o "..\\main.cpp"
..\main.cpp: In function 'int main()':
..\main.cpp:11:2: error: 'thread' is not a member of 'std'
std::thread(
^
有人建议可以什么我可能会丢失正确地得到这个编译?