This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 6.2 and shared libraries: dlopen not found
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 16 Nov 2016 15:59:59 +0000
- Subject: Re: GCC 6.2 and shared libraries: dlopen not found
- Authentication-results: sourceware.org; auth=none
- References: <A02E4412EA2EED4C92EB49F5DD4E49DCD0604FBA@SPQCMBX01.exfo.com>
On 16/11/16 15:35, Richard Sewards wrote:
> With gcc 6, it appears I must add "-ldl" when creating libtcl.so
> in order for a subsequent link that uses "-ltcl -ldl" will find
> dlopen. Without -ldl when creating libtcl.so the subsequent link
> fails to find dlopen even though it's invoked with -ldl. With
> gcc 5 this is not necessary.
This isn't really a GCC thing, it's more to do with the way that
the linker interworks with the shared library loader and the
--as-needed flag. Use -ldl always and you'll be fine.
Andrew.