[C++-sig] [Py++] wrapping boost python types fails

Roman Yakovenko roman.yakovenko at gmail.com
Sun May 31 20:41:26 CEST 2009

On Sun, May 31, 2009 at 9:30 PM, Werner Joergensen
<wjoergensen at yahoo.com> wrote:
>>> I need to use the python objects like list, str, tuple in my python extension modules. So can you help me to get the example running? I tried it on two different systems, one with gcc 4.2.4
>>>and one with gcc 4.3.3. Other relevant packages are: gccxml 0.9 (cvs from 2008-05-30), boost 1.39.0, pygccxml 1.0, pyplusplus 1.0. Can you tell me which combination of these packages
>>>can compile the short example?
>>Unfortunately, gccxml is not able to parse code, which includes
>>"boost/python.hpp" header file. You will have to find someway to
>>exclude it from compilation.
> Good to know. But do you have an explanation, why gccxml is unable?

Yes - Boost.Python is the art of template and preprocessor meta
programming. I guess, GCCXML fails to dump those template

> Is there any chance I could work on a solution, or have experienced developers already given up?

If you have experience with gcc code base, than I guess you will be
able to solve the problem. In any case, gccxml mailing list is a
better place to discuss this bug (
http://www.gccxml.org/mailman/listinfo/gccxml )

> Do you have some references of other attempts to solve the problem?


> For a workaround: It is no problem to exclude the offending code from compilation. But then how can I wrap classes that expect for example a python list as input?

Py++ doesn't support this use case, for the reason above. If you have
a lot of code, that uses Boost.Python classes, than we can work
together to patch Py++, otherwise you can use the following
functionality: http://www.language-binding.net/pyplusplus/documentation/inserting_code.html


Roman Yakovenko
C++ Python language binding

More information about the Cplusplus-sig mailing list