This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: A symbol in a shared library, which has already been resolved.
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: tanaka <tanaka at personal-media dot co dot jp>
- Cc: binutils at sources dot redhat dot com
- Date: 17 May 2004 11:04:20 -0400
- Subject: Re: A symbol in a shared library, which has already been resolved.
- References: <40A89864.3030901@personal-media.co.jp>
tanaka <tanaka@personal-media.co.jp> writes:
> This sample says,
> >./libtest.so: undefined reference to `temtem'
> .
>
> MAIN() has already been resolved, without libtest.so.1.
> Why MAIN() in libtest.so.1 is referenced?
Because shared libraries are not archive libraries. When you link
against a shared library, you get all of the associated objects,
including all of their references.
That said, you can use the --allow-shlib-undefined option to permit
shared libraries to have undefined references. You will be fine as
long as none of the undefined references are required at run time.
Ian