Locating Boost Libraries in Ubuntu

2019-08-15 17:57发布

问题:

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