[pygccxml-development] Two problems
Brought to you by:
mbaas,
roman_yakovenko
|
From: Lakin W. <lak...@gm...> - 2006-05-31 19:44:31
|
In finishing the Ogre bindings, I have run into two problems (one is
caused by the other).
1. First, I get an error when compiling Matrix4.cpp ..
lakin@zedd:~/Desktop/OgrePython$ g++ `pkg-config --cflags OGRE`
-I/usr/include/python2.4 -D"BOOST_PYTHON_MAX_ARITY=17" -O0 -g -I./
-fPIC -Ibuild -c -o build/Matrix4.pypp.os build/Matrix4.pypp.cpp
/usr/include/boost/python/object/make_instance.hpp: In static member
function 'static PyObject*
boost::python::objects::make_instance_impl<T, Holder,
Derived>::execute(Arg&) [with Arg = float*, T = float, Holder =
boost::python::objects::pointer_holder<float*, float>, Derived =
boost::python::objects::make_ptr_instance<float,
boost::python::objects::pointer_holder<float*, float> >]':
/usr/include/boost/python/to_python_indirect.hpp:96: instantiated
from 'static PyObject*
boost::python::detail::make_reference_holder::execute(T*) [with T =
float]'
/usr/include/boost/python/to_python_indirect.hpp:60: instantiated
from 'PyObject* boost::python::to_python_indirect<T,
MakeHolder>::execute(const U&, mpl_::false_) const [with U = float, T
= const Ogre::Real* const, MakeHolder =
boost::python::detail::make_reference_holder]'
/usr/include/boost/python/to_python_indirect.hpp:48: instantiated
from 'PyObject* boost::python::to_python_indirect<T,
MakeHolder>::execute(U*, mpl_::true_) const [with U = const
Ogre::Real, T = const Ogre::Real* const, MakeHolder =
boost::python::detail::make_reference_holder]'
/usr/include/boost/python/to_python_indirect.hpp:37: instantiated
from 'PyObject* boost::python::to_python_indirect<T,
MakeHolder>::operator()(const U&) const [with U = const Ogre::Real*, T
= const Ogre::Real* const, MakeHolder =
boost::python::detail::make_reference_holder]'
/usr/include/boost/python/detail/invoke.hpp:88: instantiated from
'PyObject* boost::python::detail::invoke(boost::python::detail::invoke_tag_<false,
true>, const RC&, F&, TC&, AC0&) [with RC =
boost::python::to_python_indirect<const Ogre::Real* const,
boost::python::detail::make_reference_holder>, F = const Ogre::Real*
const (Ogre::Matrix4::*)(size_t)const, TC =
boost::python::arg_from_python<Ogre::Matrix4&>, AC0 =
boost::python::arg_from_python<long unsigned int>]'
/usr/include/boost/python/detail/caller.hpp:199: instantiated from
'PyObject* boost::python::detail::caller_arity<2u>::impl<F, Policies,
Sig>::operator()(PyObject*, PyObject*) [with F = const Ogre::Real*
const (Ogre::Matrix4::*)(size_t)const, Policies =
boost::python::return_internal_reference<1ul,
boost::python::default_call_policies>, Sig = boost::mpl::vector3<const
Ogre::Real* const, Ogre::Matrix4&, long unsigned int>]'
/usr/include/boost/python/object/py_function.hpp:38: instantiated
from 'PyObject*
boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*,
PyObject*) [with Caller = boost::python::detail::caller<const
Ogre::Real* const (Ogre::Matrix4::*)(size_t)const,
boost::python::return_internal_reference<1ul,
boost::python::default_call_policies>, boost::mpl::vector3<const
Ogre::Real* const, Ogre::Matrix4&, long unsigned int> >]'
build/Matrix4.pypp.cpp:113: instantiated from here
/usr/include/boost/python/object/make_instance.hpp:24: error: invalid
application of 'sizeof' to incomplete type
'boost::STATIC_ASSERTION_FAILURE<false>'
2. But if I take Matrix4 out, (just so I can test the basics of the
bindings), I get the following:
build/TagPoint.pypp.cpp:94: instantiated from here
/usr/include/boost/python/detail/invoke.hpp:88: error: no match for
call to '(const
boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<const
Ogre::Matrix4&>) (const Ogre::Matrix4&)'
but, I have the following python code in my generate script, which (if
I understand correctly) should take care of it:
This code doesn't work, it returns 0 results:
matrix4 = ogre_ns.calldefs(return_type="const Ogre::Matrix4&")
matrix4.call_policies = call_policies.return_value_policy(
call_policies.reference_existing_object )
This code works for nearly all other pointer/reference types, but I
still get that error?!
mem_funs = ogre_ns.calldefs()
for mem_fun in mem_funs:
if mem_fun.call_policies:
continue
if declarations.is_pointer (mem_fun.return_type) \
or declarations.is_reference (mem_fun.return_type):
mem_fun.call_policies = call_policies.return_value_policy(
call_policies.reference_existing_object )
Lakin
|