This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Resolving symbols in dependent libraries
- From: Andrew Bell <andrew dot bell dot ia at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 19 Aug 2015 10:58:14 -0500
- Subject: Resolving symbols in dependent libraries
- Authentication-results: sourceware.org; auth=none
Hi,
Say I have two shared libraries, a.so and b.so. a.so depends on b.so
and links it in when it is built. Say that b.so contains the symbol
B. In my program I call B() directly.
I'd like to be able to link my program by just referring to a.so, and
have it know to look in b.so to resolve B():
g++ foo.cpp -l a
Right now it seems I have to do:
g++ foo.cpp -l a -l b
in order to get B() resolved. Is there a way to do this. Am I doing
something wrong so that the dependent library isn't searched
automatically?
Thanks,
--
Andrew Bell
andrew.bell.ia@gmail.com