Boost linkage error in Eclipse

Boost linkage error in Eclipse

等风来 发布于 2021-11-30 字数 1475 浏览 675 回复 2 原文

I've been banging my head fruitlessly against the wall attempting to include boost's thread functionality in my Eclipse C++ project on Ubuntu.

Steps so far:

Download boost from

./configure --with-libraries=system,thread
sudo make install

sudo ldconfig -v

In the eclipse project, set the include directory to:


In the linker set the library(-l) to "boost_thread"

Set the search path (-L) to


Linker runs, returns with ld error

/usr/bin/ld: cannot find -lboost_thread

as follows:

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

Here are relevant entries from /usr/local/lib:



Here are the contents of /etc/

include /etc/*.conf

How is the linker missing this?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。



需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。


爱的那么颓废 2022-06-07 2 楼

Your linker line should be saying -lboost_thread-gcc43-mt-1_38.

笑咖 2022-06-07 1 楼

Well, the linker tries to find a library called "libboost_thread.a" (or "") in its search path, which you apparently don't have.
Either create an appropriate link, or use "-lboost_thread-gcc43-mt"