Locating Boost Libraries in Ubuntu

半世苍凉 提交于 2019-12-13 18:36:48

问题


I want to build an autotools project which is making use of the boost libraries program_options and iostreams. Therefor I install those libraries:

sudo aptitude install libboost-iostreams-dev libboost-program_options-dev

Now ./configure is fine and the progam compiles. However the linking fails:

/usr/bin/ld: cannot find -lboost_program_options-mt
/usr/bin/ld: cannot find -lboost_iostreams-mt

This is a well documented issue and can be fixed either by fixing the autotools stuff or by linking boost_program_options to boost_program_options-mt and so forth. I choose to do the latter since this is not my project. However I am failing to locate the libraries installed in Ubuntu:

locate *boost*

returns a list of documentation and package information and some boost libraries I am not looking for. locate *program_options* is empty. The library is not under /usr/lib or /lib ... Any ideas?


回答1:


For me they are under /usr/lib64 in ubuntu 13.04. But I would use boost m4 to let autotool take care of these dependencies automatically. So by including boost m4 in your configure.in, you can specify which boost modules and versions you require. Morever it would also find the required paths for you.




回答2:


sometimes its impossible, especially for smaller apps and custom projects, for future, boost includes are in /usr/include/boost , of course it depends on system type and distribution



来源:https://stackoverflow.com/questions/19643122/locating-boost-libraries-in-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!