Boost logo

Boost :

From: Oliver Kullmann (O.Kullmann_at_[hidden])
Date: 2004-12-09 04:54:08

> >
> > To be on the safe side, I've built Boost again, but exactly the same problem:
> > Always the linker warnings, and every program crashes (so it had nothing to do
> > with the program_options library; fortunately it always crashes immediately, so
> > the problem is always visible). Below I've copied the relevant build commands and
> > other information.
> [snip]
> > The linking warning:
> >
> > g++ -c -o TimeHandling_Applications_DaysDifference.o TimeHandling_Applications_DaysDifference.cpp
> > g++ -o TimeHandling_Applications_DaysDifference TimeHandling_Applications_DaysDifference.o -lboost_date_time-gcc
> > /usr/bin/ld: warning:, needed by /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../, may conflict with
> The warning clearly says that requires
> - that means you compiled Boost with GCC 3.3

not necessarily --- it only means that when building,
it was *linked* to, and that exactly seems to be the problem (see below).
> Try running "ldd /usr/local/lib/" and see which
> version of libstdc++ it requires (it will say

> ldd /usr/local/lib/ => /usr/lib/ (0x4002e000) => /lib/i686/ (0x400ee000) => /usr/local/lib/ (0x40111000) => /lib/i686/ (0x4011b000)
        /lib/ => /lib/ (0x80000000)

Here you see that it links to in */usr/lib* !!

> Did you build Boost before upgrading your compiler?


> If so, when you
> re-ran "bjam install" it won't have rebuilt the libraries, it will just
> have copied the libraries you had already built (with GCC 3.3) into
> /usr/local/lib. If this is the case, you should delete the compiled
> binaries and rebuild.

I always just delete the old Boost directories.

To be safe, again(!) I've build gcc 3.4.3 and, then, after this,
Boost, and (of course) nothing changes.

The problem is as follows:

> ls -l /usr/lib/
lrwxrwxrwx 1 root root 18 2004-02-11 21:37 /usr/lib/ ->
> ls -l /usr/local/lib/
lrwxrwxrwx 1 root root 18 2004-12-09 04:42 /usr/local/lib/ ->

You see that the gcc installation put libstdc++ into /usr/local/lib, the default place.
But Boost linked to /usr/lib/, the old version.

So it seems to me that the Boost build process is erroneous:

gcc by default links first to libraries in /usr/local/lib, and then to libraries in /usr/lib
(to the best of my knowledge).

This is what one should also expect from the Boost build process, however, somehow it overrides the
default and links (first) to /usr/lib.

I'm using the only version of bjam parameters mentioned in the build instructions:

bjam "-sTOOLS=gcc" install

Obviously, to temporarily solve the problem, I could hide the lib's in /usr/lib,
but there seems to me a problem with the Boost build process which should better
be addressed.


Boost list run by bdawes at, gregod at, cpdaniel at, john at