This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 6.2 and shared libraries: dlopen not found


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]