对Boost线程的未定义引用
Undefined reference to Boost Thread
我正在尝试编译和使用Boost 1.54库,但遇到了死胡同。
我编译并安装了文档中提到的库:
./bootstrap.sh
./b2 install
我甚至尝试使用进行完全重新安装
./bootstrap.sh
./b2 threading=multi install
我已经使用-lboost_thread
和-L*path
链接以增强*/bin.v2/libs
我仍然得到以下链接器错误:
undefined reference to boost::thread::start_thread_noexcept()
undefined reference to boost::thread::join_noexcept()
我在Eclipse中的Ubuntu 12.04上使用gcc 4.6.3。
有人知道我该怎么解决吗?
在ubuntu存储库上的默认boost经历了相当多的痛苦之后,我安装了带有默认选项的boost 1.54.0(从官方网页),以下对我有效:
g++ test.cpp -o test -L/usr/local/lib/ -lboost_thread
附言:在Ubuntu 12.04上,gcc 4.63.
p.S2:我的test.cpp
中包括:
#include "boost/thread/thread.hpp"
#include "boost/bind.hpp"
相关文章:
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 编译时的 CImg 库返回对"__imp_SetDIBitsToDevice"的未定义引用
- 对Py_Initialize()的未定义引用
- 使用mysql c++连接器的未定义引用
- 对 Scalar ::Scalar() 的未定义引用
- 对复制 CTOR 和 CTOR 的未定义引用
- 对显式实例化的模板函数的未定义引用
- TensorRT (C++ API) 对"createNvOnnxParser_INTERNAL"的未定义引用
- 2个模板化类的非模板友元函数未定义引用错误
- 编译 libfluid 样本控制器时对"event_base_del_virtual"的未定义引用
- 获取对function_name的未定义引用
- 对 'std::thread::_M_start_thread CMake 的未定义引用进行基准测试
- 对结构方法的未定义引用
- 使用内联函数 c++ 的未定义引用
- 对 CMake 中'cudaRegisterLinkedBinary'链接错误的未定义引用?
- 对 DLOPEN 的未定义引用
- QT C++中对全局变量的未定义引用
- 快速数学导致对"__pow_finite"的未定义引用
- 对 boost::system::d etail::system_category_instance 的未定义引用,从
- OpenCV 3.4.3 中对 'cv::String::d eallocate()' 错误的未定义引用