Re: [pygccxml-development] code generation problem, py++ bug??
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2007-01-10 06:30:57
|
On 1/10/07, Allen Bierbaum <al...@vr...> wrote:
> Roman:
>
> Note: I am e-mailing you directly because I have a bug report with a
> rather large attachment so I didn't want to blanket everyone on the list
> with the file.
The support will be given on the mailing list. Thus my answers available to
other users too.
> If you extract the attached file it will create a directory called
> pypp_vector_problem. There is a python py++ generation script, an
> gccxml XML file, and example output. I have also attached the header
> file that has the methods I am trying to wrap. I am using the latest
> svn HEAD but I have also replicated this problem with several older
> versions of Py++ from a couple months ago.
I will appreciate if next time you at least will try to create small
test case that
reproduce the problem:
#include <vector>
namespace osg{
struct node{};
node* clone_tree( const std::vector<std::string>
&types=std::vector<std::string>() );
}
That is all the code needed to reproduce the error.
> The problem is the 'bp::arg("...")=vector<' parts of the generated
> code. This shows up for multiple of the generated methods. Because it
> does not use std::vector the compiler can not build the code and fails
> pretty miserably.
>
> I have checked older versions of Py++ and it looks like this has been
> the way the code works for quite a while.
>
> Do you have any ideas? Is there something I am missing here or am I
> just misusing Boost.Python in some way? Is it a bug in Py++?
This is a gccxml bug:
http://www.language-binding.net/pygccxml/design.html#patchers
In this case I cannot create patcher. Also I hope I will be able to do
this in future.
I can explain why if you want.
What should you do in order to compile the generated code:
mb = module_builder_t( ....)
mb.code_creator.add_namespace_usage( 'std' )
This should solve the problem. The functionality presents even in very
old version
of Py++. If it does not help you have to change default value strings:
for arg in f.arguments:
arg.default_value = ...
Or you can ask Py++ to generate code without default arguments:
f.use_default_arguments = False
Or you can use BOOST_PYTHON_FUNCTION_OVERLOADS macro as explained
here: http://www.language-binding.net/pyplusplus/documentation/functions/overloading.html#overloading-using-macros
You have plenty of options to deal with the bug
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|