[C++-sig] boost.python error

Ricardo Kirkner ricardokirkner at gmail.com
Sun Nov 6 17:13:15 CET 2005


I give you the code returned by pyste (which I am using to build the
wrapper). Maybe you can tell me whats wrong with it. I also include
the original source (OpalMath.h)

I also post my Jamfile and Jamrules files.

When I build with bjam, I get an error telling me

ImportError: ./OpalMath.so: undefined symbol:
_ZTVN5boost6python7objects21py_function_impl_baseE

when I build using g++ directly I get the error

ImportError: dynamic module does not define init function (initOpalMath)

To build using g++ I use

g++ -c -Wall -fPIC -I/usr/include/boost -I/usr/include/python2.3 -Isrc
-o OpalMath.o OpalMath.cpp
g++ -shared -fPIC -Wl --no-undefined --warn-once -L/usr/lib
-lpython2.3 -lboost_python -DBOOST_PYTHON_DYNAMIC_MODULE -o
OpalMath.so OpalMath.o

I hope this info can tell you something about why I am not succeeding
in building this very small wrapper...

Thanks in advance

Ricardo Kirkner

On 11/6/05, Ralf W. Grosse-Kunstleve <rwgk at yahoo.com> wrote:
> --- Ricardo Kirkner <ricardokirkner at gmail.com> wrote:
> > ImportError: dynamic module does not define init function (initopal)
>
> If you want to enable "import opal" you need to write
>
> BOOST_PYTHON_MODULE(opal)
>
> in your Boost.Python extension.
>
> Cheers,
>         Ralf
>
>
>
>
> __________________________________
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpalMath.cpp
Type: text/x-c++src
Size: 934 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20051106/ed159a1c/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpalMath.h
Type: text/x-chdr
Size: 3640 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20051106/ed159a1c/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jamfile
Type: application/octet-stream
Size: 421 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20051106/ed159a1c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jamrules
Type: application/octet-stream
Size: 1580 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20051106/ed159a1c/attachment-0001.obj>


More information about the Cplusplus-sig mailing list