我在Linux UBUNTU下工作eclipse 10.10,使用Synaptic pkg管理器安装了boost-dev软件包1.40.我是linux新手,这可以提升pkg.我尝试创建一个新项目,并写道:
#include <boost/thread.hpp>
int main(int argc, char* argv[]){
}
Run Code Online (Sandbox Code Playgroud)
我没有包含任何内容或在任何地方写任何像pthread.在尝试构建时,它说:
/usr/include/boost/config/requires_threads.hpp:47: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
In file included from /usr/include/boost/thread/thread.hpp:12,
from /usr/include/boost/thread.hpp:13,
from ../main.cpp:8:
/usr/include/boost/thread/detail/platform.hpp:67: error: #error "Sorry, no boost threads are available for this platform."
In file included from /usr/include/boost/thread.hpp:13,
from ../main.cpp:8:
/usr/include/boost/thread/thread.hpp:19: error: #error "Boost threads unavailable on this platform"
Run Code Online (Sandbox Code Playgroud)
等等,很多与boost相关的错误.我试图添加-pthread,-pthreads …