我的主机操作系统是:
Fedora 22 x64
gcc-g++ 版本是:
5.1.1
日食 cdt 版本:
Eclipse CDT Mars Release V4.5.0
这是我的简单演示代码列表:
#include <thread>
void func(){}
int main(int argc, char** argv)
{
std::thread ts(func);
ts.join();
return 0;
}
这是我的 cdt 配置(错误配置):
Project Properties->C/C++Build->Tool Chain Editor->(use Linux GCC as current)
Project Properties->C/C++Build->Settings->GCC C++ Compiler->Dialet->(ISO C++11)
Project Properties->C/C++Build->Settings->GCC C Compiler->Dialet->(ISO C11)
Project Properties->C/C++Build->Settings->GCC C++ Linker->(add pthread)
Project Properties->C/C++General->Paths and Symbols->Symbols
->add '__GXX_EXPERIMENTAL_CXX0X__' to GNU C++
Project Properties->C/C++General->PreprocessorIncludePaths,Macros etc.->Providers
->(Select only 'CDT GCC Built-in Compiler Settings' and add'-std=c++11' to command)
结果是:
the project can build and run successfully
but eclipse CDT always show error: Symbol 'thread' could not be resolved