Boost logo

Boost-Build :

From: Tomas Puverle (Tomas.Puverle_at_[hidden])
Date: 2006-06-17 18:43:54

> gcc (GCC) 4.1.1 (OpenPKG-CURRENT)
> GNU ld version 2.16.1

> Caleb Epstein


My Solaris gcc is 3.4.5-2 and it looks like the linker is also GNU's:

$ <path-to-gcc>/g++ -print-prog-name=ld
$ <path-to-gcc>/ld -v
GNU ld version 20040927

The behaviour you describe is not Solaris specific. Running g++ on
Linux exactly as you describe produces the same results. I think when
specifying the -Bstatic/dynamic, you need pass the options to the linker
instead of the compiler:

-Wl,-Bstatic -lgreet -Wl,-Bdynamic

This seems to work for me on both platforms. -Bstatic/dynamic on Suncc
do affect the linker but on gcc the -B option is in fact used to tell
the compiler where its subcomponents live:

           This option specifies where to find the executables,
           include files, and data files of the compiler itself.

           The compiler driver program runs one or more of the
           cpp, cc1, as and ld. It tries prefix as a prefix for each
           it tries to run, both with and without machine/version/.

           For each subprogram to be run, the compiler driver first
tries the
           -B prefix, if any. If that name is not found, or if -B was
           specified, the driver tries two standard prefixes, which are
           /usr/lib/gcc/ and /usr/local/lib/gcc/. If neither of those
           in a file name that is found, the unmodified program name is
           searched for using the directories specified in your PATH
           environment variable.

<snip rest of man>

As you can see, what you are doing with -Bstatic is telling the g++ to
look for cc1 etc in a directory called "static", which I think is not
what you intended :) And since the linker always favours a dynamic
library over a static one, that explains why you always had a dependency

Hope that helps,


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at