[C++-sig] pyplusplus tutorials & GUI wizard

Matthias Baas baas at ira.uka.de
Mon Jan 30 19:24:00 CET 2006


Roman Yakovenko wrote:
>> I extended my test and already added more than one class and tried the
>> write_multiple_files() function. Basically, it works fine, but one
>> problem still remains: The output files will only compile if I include
>> some additional header files (which actually depend on the class I'm
>> wrapping). So how do I tell pyplusplus to add those headers to the
>> output files? (in Pyste I was using the declaration_code() function)
> 
> Every code block that is written in file, is created  by some code creator.
> 
> There are 2 relevant code creators:
>    1. include_t
>    2. precompiled_header_t
> 
> __init__ method takes file path/name to be included.
> 
> module_t class has method adopt_include. As argument it takes
> include_t instance.

ok, for every header I have a line:

extmodule.adopt_include( code_creators.include_t("myheader.h") )

The module compiles now. However, the above include files are inserted 
into every generated *.cpp file. I don't know if this will ever be a 
problem or not, but while I'm at it, how could I be more specific and 
add headers (or other code) to only some selected output files?

Anyway, I'll continue my test and move on to the more complex classes 
that needed some manual intervention using Pyste....

- Matthias -




More information about the Cplusplus-sig mailing list