小编and*_*ssh的帖子

如果在Linux Ubuntu中包含boost/thread,则不编译:)10.10

我在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 …

c++ linux boost compiler-errors

5
推荐指数
3
解决办法
1万
查看次数

标签 统计

boost ×1

c++ ×1

compiler-errors ×1

linux ×1