This is the mail archive of the
mailing list for the binutils project.
Re: -Bstatic & -shared problems / example
On Tue, Apr 16, 2002 at 02:22:40PM +0200, Franz Sirl wrote:
> >Because as far as I can see, these should be identical. The difference:
> archive != object file for the linker. Again, you have misordered your
> command line, there is no object file listed in front of the libraries, so
> no need for the linker to extract anything from the libraries cause there
> is no consumer (yet). Try:
Ok - my apologies. I've learned a valuable thing today - the order of
objects on the commandline matters.
> $ g++ pgsqlbackend.o -L/opt/postgresql/lib -lssl -lcrypt
> -lcrypto -Wl,-Bstatic -lpq++ -lpq -Wl,-Bdynamic -Wl,-soname
> -Wl,libgpsqlbackend.so.0 -shared -o libgpgsqlbackend.so
> BTW, this is quite off-topic here, these are linker basics that have
> nothing to do with binutils in particular.
This fixes the problem completely and I am grateful and will shut up now.
http://www.PowerDNS.com Versatile DNS Software & Services
http://www.tk the dot in .tk
http://lartc.org Linux Advanced Routing & Traffic Control HOWTO