Linking Python modules to C++ modules...a problem

Makhno mak at imakhno.freeserve.co.uk
Sun Apr 2 05:04:20 EDT 2000


I'm trying to write an interface to a library written in C++ from Python, on
the BeOS.
The module is called OrchardExt, and I want to link it to a library called
libOrchard.so

So I create an appropriate OrchardExt.c and a OrchardExtwrapper.c, the
wrapper contains the functions (extern'd "C") that simply 'pass on' the
function call to the libOrchard.so library, whereas the OrchardExt.c file is
empty (except for an #include that include the declarations for the
library).

I run
Make -f Makefile.pre.in boot

I edit the Makefile, making it link to the appropriate libraries and
ensuring that it will compile in C++.
then:
make
make install

Unfortuanately, this doesn't work. The output is shown below.

Do I need to recompile the Python binary for the BeOS with a C++ compiler,
or is such module compiling screwed on the BeOS for Python?
I have already written the Perl interface to this library, and it worked a
lot more beautifully than this.

~~~~~~~~~~


Traceback (innermost last):
  File "/boot/home/Py_script", line 2, in ?
    import OrchardExt
ImportError: Unknown error loading
/boot/home/config/lib/python1.5/site-packages/OrchardExt.so








More information about the Python-list mailing list