help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shared versus archive library


From: Greg
Subject: shared versus archive library
Date: 27 Oct 2005 09:31:06 -0700
User-agent: G2/0.2

I am trying to link an executable with a number of shared libraries.
Functions in some of these libraries refer to other functions which are
defined by objects within the executable code.  Think of these as
callbacks.  These symbols are specified with "#pragma weak symbol" as
the expectation is that not all objects linking against these libs
use/need all of the symbols.  All objects (in library and main program)
were compiled with -fPIC.  The shared library is compiled with -shared.
 The executable is linked with --export-dynamic.

Here is the problem:
If I link against the archive libraries the program links fine and it
runs.
If I link against the shared libraries the linker complains about
undefined symbols.  When I quiet these errors down with
--allow-shlib-undefined then the linking completes.  But at run time
the loader complains about undefined symbols.
Am I missing some compiler options when linking the .so libraries?

Thanks for any help.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]