HPUX shared Libraries

HPUX shared Libraries

Post by Jim Baret » Sat, 08 Mar 1997 04:00:00



I'm dynamically loading a shared library via shl_load (BIND_DEFERRED) and
trying to get the address of a symbol via shl_findsym.  If I use the -E
link flag when building the shared library and then try to find the symbol
with shl_findsym it returns an error 215.  I used shl_getsymbols to print
all the symbols (TYPE_PROCEDURE, EXPORT_SYMBOLS) and it shows no symbols -
error 215.  If I try EXPORT_SYMBOLS | IMPORT_SYMBOLS then shl_getsymbols
shows my C++ member functions but does not show any of my routines that
were defined as extern "C" even though the shared library was built with
the -Wl,-E flag.  If I try to explicitly export them with a command like
-Wl,+eCREATEDCOBJECT then I get the error

"CC: error: could not find __shhead symbol.  You must use CC to link.  If
your main is not in C++, a call to _main() is required.(740)"

What is the proper way to export specific routines but not all routines in
the shared library?  Why does the +e link option return this error?

Any help would be appreciated.