[C++-SIG] Fw: the dynamic load mystery...

Paul F. Dubois dubois1 at llnl.gov
Thu Apr 2 01:44:43 CEST 1998


I've been trying to get my recent C++ work to work on an HPUX-10 system. It
compiles and makes a dynamic library just fine; or you can build it into a
static application. In the static case, everything is fine. In the dynamic
case, python 1.5 complains that the shared library does not not contain the
module's init routine, named initexample. But, as you'll see below, it does.

In an effort to diagnose this, we took the spammodule.c example, changed
spammodule.c to spammodule.cxx, adding the
external "C" statement for initspam, and made it on an HP using KCC -x and
cc -Ae. Works fine: import spam succeeds.

Then we changed the name spaminit everywhere to exampleinit, and renamed the
file example.cxx. Works fine: import example succeeds.

Copied this example.cxx into the CXX/Demo directory and rebuilt there.
Works fine.

Added one line to example.cxx: #include "CXX_Objects.h".
Now we get the failing behavior. nm reveals

laura[63] nm *.sl | grep initexample
00032d08 T __sti____Demo_example_cxx_initexample
00032cf0 T __sti____Demo_example_cxx_initexample
000316f4 T initexample
00031694 T initexample

Demo/example.cxx is the file name in which initexample resides. I wonder if
this extra initexample inside a name is confusing some part of the dynamic
load.

Does any of this ring a bell with anyone?






More information about the Cplusplus-sig mailing list