[英]Boost linkage error in Eclipse
我一直不知所措,试图在Ubuntu上的Eclipse C ++项目中加入boost的线程功能。
到目前为止的步骤:
从boost.org下载boost
./configure --with-libraries=system,thread
make
sudo make install
sudo ldconfig -v
在eclipse项目中,将include目录设置为:
/usr/local/include/boost-1_38/
在链接器中,将库(-l)设置为“ boost_thread”
将搜索路径(-L)设置为
/usr/local/lib
链接器运行,返回ld错误
/usr/bin/ld: cannot find -lboost_thread
如下:
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o"boostHello3" ./src/boostHello3.o -lboost_thread
/usr/bin/ld: cannot find -lboost_thread
collect2: ld returned 1 exit status
以下是/ usr / local / lib中的相关条目:
libboost_system-gcc43-mt-1_38.a
libboost_system-gcc43-mt-1_38.so
libboost_system-gcc43-mt-1_38.so.1.38.0
libboost_system-gcc43-mt.a
libboost_system-gcc43-mt.so
libboost_thread-gcc43-mt-1_38.a
libboost_thread-gcc43-mt-1_38.so
libboost_thread-gcc43-mt-1_38.so.1.38.0
libboost_thread-gcc43-mt.a
libboost_thread-gcc43-mt.so
这是/etc/ld.so.conf的内容
include /etc/ld.so.conf.d/*.conf
/usr/local/lib
链接器如何丢失此信息?
很好,链接器尝试在其搜索路径中找到一个名为“ libboost_thread.a”(或“ libboost_thread.so”)的库,您显然没有该库。 创建适当的链接,或使用“ -lboost_thread-gcc43-mt”
您的链接器行应该说-lboost_thread-gcc43-mt-1_38
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.