|
Boost : |
From: hugogeek_at_[hidden]
Date: 2002-01-18 05:50:38
I have the following in my wrapper "code":
python::class_builder<Terrain> Terrain_class(this_module, "Terrain");
Creating the constructor like so doesn't work:
Terrain_class.def(python::constructor<char*, int, bool, float, float, int, int>());
Is it the char* that is bothering? (The docs made me think it does
support char*.)
Furthermore, as soon as I add any methods:
Terrain_class.def(&Terrain::Render, "Render");
it compiles fine, but when I try to import it in python:
Traceback (most recent call last):
File "./basic.py", line 5, in ?
import demeterwrap ImportError: ./demeterwrap.so: undefined symbol: __tfQ27Demeter7Terrain
I am linking to libDemeter.a just fine, I believe, I have other classes
also wrapped and they do not cause this problem. (As soon as I remove
all Terrain_class.def statements, it works fine.)
nm libDemeter.a gives me:
00002d98 T _._Q27Demeter7Terrain
Can anyone shed light on this problem? Where should I be looking?
Can one add members to the python class? (Is my terminology right? I've
only added methods so far, I also want access to e.g. "float a;". This
possible?)
Last thing:
WARNING: Python C API version mismatch for module demeterwrap:
This Python has API version 1010, module demeterwrap has version 1007.
This is because I am using python2.1 while boost.python only supports
python2.0? (and 1.5.) I can install python2.0 and work with that if
necessary. I'm just curious whether it will support 2.1 soon, or maybe
already... version of the Debian libboost-python-dev package I have:
Version: 1.21.1-1
Thanks,
Hugo van der Merwe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk