我使用MacPorts编译并安装了gcc4.4。
当我尝试使用命令“g++ -g -Wall -ansi -pthread -std=c++0x main.cpp”进行编译时...
编译器返回:
当我尝试使用命令“g++ -g -Wall -ansi -pthread -std=c++0x main.cpp”进行编译时...
#include <thread>
...
std::thread t(handle);
t.join();
....
编译器返回:
cserver.cpp: In member function 'int CServer::run()':
cserver.cpp:48: error: 'thread' is not a member of 'std'
cserver.cpp:48: error: expected ';' before 't'
cserver.cpp:49: error: 't' was not declared in this scope
但是std::cout <<...
可以正常编译。
有人能帮我吗?
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
。但我不确定,您需要做些什么才能定义它们。 - UncleBens