开发者

boost library gives errors on ubuntu

开发者 https://www.devze.com 2022-12-26 10:08 出处:网络
I am trying to compile a package on ubuntu 8.1 when executing this command: ./configure I get the follwo开发者_开发知识库ing error:

I am trying to compile a package on ubuntu 8.1

when executing this command: ./configure I get the follwo开发者_开发知识库ing error:

checking for Boost headers version >= 103700... no configure: error: cannot find Boost headers version >= 103700

knowing that I installed needed boost packages using these command:

$ apt-get install libboost-dev libboost-graph-dev libboost-iostreams-dev

Can anybody help please?


thank you. Now it works but i get another error when running ./configure: checking boost/iostreams/device/file_descriptor.hpp usability... yes checking boost/iostreams/device/file_descriptor.hpp presence... yes checking for boost/iostreams/device/file_descriptor.hpp... yes checking for the Boost iostreams library... no configure: error: cannot not find the flags to link with Boost iostreams any ideas please?


It could be that the version of boost that you're getting from the Ubuntu repository is too old (it's suggested here that the highest version for 8.10 is 1.35; it looks like your configure script is asking for 1.37). You might need to build from source; there's some more info in the answers to the question I linked to which will hopefully help.

UPDATE:

From your new error, it sounds like configure now can't find the boost_iostreams library. On my system it's /usr/lib/libboost_iostreams-mt.[a|so] - do you have those files (possibly in a different directory depending on where you installed boost)?

You can also try running ldconfig in case there's a missing symlink (from, say, libboost_iostreams-mt.so.1.37.0 to libboost_iostreams-mt.so).

Is this configure one generated by GNU autoconf? If it is, there should be a file called config.log in the same directory which contains a list of all the commands configure tried to run when looking for things. If there's anything in there about boost_iostreams could you post it?

One totally random guess: some examples I've found on the web link to boost_iostreams without the multi-threading suffix -mt - but I don't have those on my machine at all. Maybe your configure script is running into the same problem?

UPDATE 2

The configure script seems to be looking for a single-threaded debug build of the boost iostreams library, which won't be produced by default when building from source on linux. Also, the default on linux is not to name the libraries based on the build configuration (so the libs you found in /usr/lib might not be the ones you installed from source unless you overrode this). This stuff isn't really explained on the boost website, I only found out by looking in the Jamroot file (bjam --help works too)! Anyway, to get a library with the right build configuration, and named correctly, I need to go into the root of the boost source tree and run:

sudo bjam --with-iostreams --layout=tagged variant=debug threading=single install

For me this puts the libraries (libboost_iostreams-d.a and the shared versions) into /usr/local/lib where ld will find them by default, so this should be fine. If you need them to go somewhere else you can use the --prefix=... option to bjam eg. if you want them in /usr/lib you can do --prefix=/usr. If the package you're building needs more boost libraries you can remove the --with-iostreams and then they'll all be built (or replace iostream with the name of each other library you need).

A side note: I had to install the libbz2-dev package to get boost iostreams to build - it's easy to miss the error here if you build all of boost as there's so much output!

0

精彩评论

暂无评论...
验证码 换一张
取 消