[pygccxml-development] copy constructor woes
Brought to you by:
mbaas,
roman_yakovenko
From: Lakin W. <lak...@gm...> - 2006-05-29 04:39:37
|
In working some more on the bindings for Ogre, I tried to compile the following class: http://lakin.weckers.net/ogre/cpp/Frustum.pypp.cpp The Frustum class that Ogre defines has a member variable: VertexData mVertexData; But VertexData defines a protected Copy constructor. Now, Ogre compiles and works fine, because the Frustum class itself doesn't define a copy constructor, and no code uses the copy constructor, (So it's not generated by the compiler, iirc). However, in the generated wrapper, the Copy Constructor is used, and then g++ generates the appropriate error: g++ `pkg-config --cflags OGRE` -I/usr/include/python2.4 -DBOOST_PYTHON_MAX_ARITY=16 -fPIC -Icpp -c -o cpp/Frustum.pypp.os cpp/Frustum.pypp.cpp /home/lakin/.local/include/OGRE/OgreFrustum.h: In copy constructor 'Ogre::Frustum::Frustum(const Ogre::Frustum&)': /home/lakin/.local/include/OGRE/OgreVertexIndexData.h:43: error: 'Ogre::VertexData::VertexData(const Ogre::VertexData&)' is private /home/lakin/.local/include/OGRE/OgreFrustum.h:62: error: within this context cpp/Frustum.pypp.cpp: In constructor 'Frustum_wrapper::Frustum_wrapper(const Ogre::Frustum&)': cpp/Frustum.pypp.cpp:13: warning: synthesized method 'Ogre::Frustum::Frustum(const Ogre::Frustum&)' first required here scons: *** [cpp/Frustum.pypp.os] Error 1 scons: building terminated because of errors. I'm going to file a bug with the Ogre guys, as I'm fairly certain that they would want to define a copy constructor that works. :) OGRE's api and general usage pattern will avoid copy constructors, using and passing around pointers. However, that leads to a question: Is this also a bug in pyplusplus? Lakin |