Compilation errors to do with indexing.

Phobius

28-12-2008 23:24:54

Trying to compile, i get the following types of errors.

12-29 09:39 PythonOgre.BuildModule DEBUG /home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp: In static member function 'static boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::signature() [with F = boost::python::list (*)(std::vector<CEGUI::PropertyLinkDefinition, std::allocator<CEGUI::PropertyLinkDefinition> >&, boost::python::indexing::slice), Policies = boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >, Sig = boost::mpl::vector3<boost::python::list, std::vector<CEGUI::PropertyLinkDefinition, std::allocator<CEGUI::PropertyLinkDefinition> >&, boost::python::indexing::slice>]':
/home/user/stor/boost_1_35_0/boost/python/object/py_function.hpp:48: instantiated from 'boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl<Caller>::signature() const [with Caller = boost::python::detail::caller<boost::python::list (*)(std::vector<CEGUI::PropertyLinkDefinition, std::allocator<CEGUI::PropertyLinkDefinition> >&, boost::python::indexing::slice), boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >, boost::mpl::vector3<boost::python::list, std::vector<CEGUI::PropertyLinkDefinition, std::allocator<CEGUI::PropertyLinkDefinition> >&, boost::python::indexing::slice> >]'
generated/cegui_0.6.2b/PropertyLinkDefinitionList.pypp.cpp:27: instantiated from here
/home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp:235: error: no class template named 'extract_return_type' in 'struct boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >'
/home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp:236: error: no class template named 'extract_return_type' in 'struct boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >'
/home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp:242: error: no class template named 'extract_return_type' in 'struct boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >'
/home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp:242: error: no class template named 'extract_return_type' in 'struct boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >'
/home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp:242: error: no class template named 'extract_return_type' in 'struct boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >'
/home/user/stor/boost_1_35_0/boost/python/detail/caller.hpp:242: error: no class template named 'extract_return_type' in 'struct boost::python::indexing::detail::postcall_override<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies> >'
scons: *** [build_dir_2.5/cegui_0.6.2b/PropertyLinkDefinitionList.pypp.os] Error 1


I use boost::python on a regular basis, and this has to do with the indexing. My first question would have to be why python-ogre has a separate indexing library compiled when boost::python comes with indexing already. I assume there's some custom mod done to it, what does it do?

There is a trait i've noticed. This error only happens on source files which try to define a function that returns vector types; or define vector types as in OIS::Vector3. Anything to do with containers actually, vectors, lists, etc. All other source files compile fine.

I'm using the new python-ogre for 1.6.0, the 1.4.8 python-ogre i was using before compiled fine, no dramas, so something's changed.

Thanks.
--Tom G.

dermont

30-12-2008 07:11:35

The latest svn version of Py++ has implemented the indexing suite of headers so it doesn't require any linking etc into existing boost libraries. The current svn may be in a state of flux at the moment so I'm not sure if this has been fully implemented.

Even using the latest version of Py++ I still encountered similar problems to you and still had to patch boost/detail/preprocessor.hpp as per the boost build commands in environment.py (now commented out). You could try manually updating preprocessor.hpp to see if it resolves your problem, namely adding the following define and setting BOOST_PYTHON_MAX_ARITY to 19:

#define BOOST_PYTHON_NO_PY_SIGNATURES
..
# define BOOST_PYTHON_MAX_ARITY 19