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: libstdc++.so.5, needed by /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../libboost_date_time-gcc.so, may conflict with libstdc++.so.6
>
> The warning clearly says that libboost_date_time-gcc.so requires
> libstdc++.so.5 - that means you compiled Boost with GCC 3.3
>

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

> ldd /usr/local/lib/libboost_date_time-gcc.so
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4002e000)
        libm.so.6 => /lib/i686/libm.so.6 (0x400ee000)
        libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40111000)
        libc.so.6 => /lib/i686/libc.so.6 (0x4011b000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Here you see that it links to libstdc++.so.5 in */usr/lib* !!

> Did you build Boost before upgrading your compiler?

no;

> 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/libstdc++.so
lrwxrwxrwx 1 root root 18 2004-02-11 21:37 /usr/lib/libstdc++.so -> libstdc++.so.5.0.5
> ls -l /usr/local/lib/libstdc++.so
lrwxrwxrwx 1 root root 18 2004-12-09 04:42 /usr/local/lib/libstdc++.so -> libstdc++.so.6.0.3

You see that the gcc installation put libstdc++ into /usr/local/lib, the default place.
But Boost linked to /usr/lib/libstdc++.so, 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.

Oliver


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk