This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How do I link to a shared lib without having that lib'sdependencies (the way MS link does)
- From: David Wuertele <dave-gnus at bfnet dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 12 Aug 2003 11:35:38 -0700
- Subject: Re: How do I link to a shared lib without having that lib'sdependencies (the way MS link does)
- Cancel-lock: sha1:SVSiz23pKn4xY2ywuKly8+JbfG8=
- Organization: Berkeley Fluent Network
- References: <m38ypz1udy.fsf@bfnet.com> <20030812181123.GC11767@redhat.com>
Me> # Compile and link prog.c to libA.so
Me> gcc -o prog prog.c -L. -lA
Me> /usr/bin/ld: warning: libB.so, needed by ./libA.so, not found
Me> (try using -rpath or -rpath-link)
Richard> Did you even try the suggestion? Adding -rpath-link=. would
Richard> indeed have solved your problem.
The first thing I did was read the manual, and discover that
-rpath-link= doesn't do what I want.
Then I tried it, and confirmed it doesn't do what I want.
I want to be able to link to libA.so WITHOUT libB.so being on the disk
or on anyone's disk.
The libB.so will be available at runtime ONLY. Not at link time.
Dave