/usr/bin/ld: cannot find -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_thread-mt
我正在尝试使用以下命令链接项目:
g++ build/test.o -o bin/test -pthread -L lib -L /home/alexander/opt/lib -lboost_thread-mt
这会导致以下错误:
/usr/bin/ld: cannot find -lboost_thread-mt
collect2: error: ld returned 1 exit status
但是,boost
库安装在目录 /home/alexander/opt/lib
中。为什么链接器找不到提升库?我还尝试与-I
链接,如果-L
具有相同的结果......
/home/alexander/opt/lib
的内容/home/alexander/opt/lib/boost_1_57_0
。
将
libboost_thread-mt更改为libboost_thread,首先找到libboost_thread.so和libboost_thread.a的地址,然后在同一地址中建立这些文件的软链接,所以它应该是:
ln -s /...libboostSourceFiles.../libboost_thread.so /..RequestTOmtFiles.../libboost_thread-mt.so
它也适用于其他 libboost -mt 文件,如序列化、iostreams、程序选项
相关文章:
- 在std::thread中,joinable()然后join()线程安全吗
- <Windows>为什么 std::thread::native_handle 返回类型为"long long unsigned int"的值,而不是 void*(又名 HANDLE)?
- 分离一个静态常量 std::thread?
- 尝试使用 std::vector<std::thread时出现静态断言失败错误>
- 使用 thread 类在 C++ 中构造线程的动态数组时出错
- 当指向对象的指针作为参数传递给 std::thread 时,内存可见性
- 如何从 std::thread 返回值
- 在C++中使用并行化的预期速度是多少(不是 OpenMp,而是 <thread>)
- 将 std::thread by 值推送到列表中
- 转发变量参数列表以模拟 std::thread
- 嵌入式设备 -> std::thread -> FreeRTOS?
- 对 'std::thread::_M_start_thread CMake 的未定义引用进行基准测试
- std::thread 增加 DLL 引用计数,从而防止卸载 DLL
- 如何防止 std::thread 在 QT 中冻结 GUI?
- 对带有唯一指针的 std::thread 使用类成员函数时出现编译错误
- C++ - Thread Pool
- 为什么参数在构造 std::thread 时移动两次
- 为什么在Visual Studio的OpenCV项目中使用/MT时仍然需要dll?
- std::thread::_Invoker 使用线程编程时出错
- Cpp-netlib抱怨缺少lboost-thread