[pygccxml-development] problem with an array of pointers
Brought to you by:
mbaas,
roman_yakovenko
|
From: Gordon W. <gor...@gm...> - 2008-07-07 07:27:59
|
Disclaimer: I have no idea what I'm doing and C++ is not one of my strong
skills. I'm having a problem with py++, boost, msvc and a third party
library I need to bridge to python. I would greatly appreciate any help I
can get with this.
I don't have the various version information handy but I downloaded all of
the boost/py++/msvc stuff from the relevant websites last week. After I
installed everything I made it compile and run the quick start example
correctly.
I ran the library header through the py++ gui, grabbed the py++ code that
generated, put it in a .py file, ran that and then copied the resulting
files into the quick start example.
The header for the library includes this snippet (details obscured to
protect the guilty):
class bob
{
public:
double *fred[4];
Which produced these snippets in bindings.cpp
struct bob_wrapper : bob, bp::wrapper< bob > {
<snip>
static pyplusplus::containers::static_sized::array_1_t< double *, 4>
pyplusplus_fred_wrapper( ::bob & inst ){
return pyplusplus::containers::static_sized::array_1_t< double *,
4>( inst.fred );
}
BOOST_PYTHON_MODULE(pyplusplus){
{ //::bob
<snip>
pyplusplus::containers::static_sized::register_array_1< double *, 4,
bp::return_internal_reference< > >( "__array_1_double__ptr__4" );
{ //bob::fred [variable], type=double *[4]
typedef pyplusplus::containers::static_sized::array_1_t< double
*, 4> ( *array_wrapper_creator )( ::bob & );
bob_exposer.add_property( "fred"
, bp::make_function(
array_wrapper_creator(&bob_wrapper::pyplusplus_fred_wrapper)
, bp::with_custodian_and_ward_postcall<
0, 1 >() ) );
}
which seem to be responsible for this mess
C:\PROGRA~1\boost\BOOST_~1\libs\python\example\QUICKS~1>bjam.exe
--toolset=msvc
warning: Graph library does not contain optional GraphML reader.
note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the
note: directories containing the Expat headers and libraries, respectively.
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
...patience...
...found 1193 targets...
...updating 3 targets...
compile-c-c++ bin\msvc-9.0express\debug\threading-multi\extending.obj
extending.cpp
C:\PROGRA~1\boost\BOOST_~1\boost/python/detail/unwind_type.hpp(165) : error
C2664: 'boost::python::converter::detail::unwind_type_id_helper::result_ty
pe boost::python::detail::unwind_helper2<1>::execute<Generator,double>(U
*(__cdecl *)(void),Generator *)' : cannot convert parameter 1 from 'double
*c
onst (__cdecl *)(void)' to 'double *(__cdecl *)(void)'
with
[
Generator=boost::python::converter::detail::unwind_type_id_helper,
U=double
]
This conversion requires a reinterpret_cast, a C-style cast or
function-style cast
C:\PROGRA~1\boost\BOOST_~1\boost/python/converter/pytype_function.hpp(45) :
see reference to function template instantiation 'boost::python::c
onverter::detail::unwind_type_id_helper::result_type
boost::python::detail::unwind_type<boost::python::converter::detail::unwind_type_id_helper,T>(boo
st::type<T> *,Generator *)' being compiled
with
[
T=double *const ,
Generator=boost::python::converter::detail::unwind_type_id_helper
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/converter/pytype_function.hpp(67) :
see reference to function template instantiation 'boost::python::t
ype_info boost::python::converter::detail::unwind_type_id_<T>(boost::type<T>
*,boost::mpl::false_ *)' being compiled
with
[
T=double *const
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/converter/pytype_function.hpp(65) :
while compiling class template member function 'const PyTypeObject
*boost::python::converter::expected_pytype_for_arg<T>::get_pytype(void)'
with
[
T=double *const
]
C:\PROGRA~1\boost\BOOST_~1\boost/preprocessor/iteration/detail/local.hpp(34)
: see reference to class template instantiation 'boost::python::c
onverter::expected_pytype_for_arg<T>' being compiled
with
[
T=double *const
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/detail/signature.hpp(76) :
while compiling class template member function 'const boost::python::detail
::signature_element *boost::python::detail::signature_arity<2>::im
pl<Sig>::elements(void)'
with
[
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/detail/signature.hpp(58) :
see reference to class template instantiation 'boost::python::detail::signa
ture_arity<2>::impl<Sig>' being compiled
with
[
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/detail/caller.hpp(232) : see
reference to class template instantiation 'boost::python::detail::signatu
re<Sig>' being compiled
with
[
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/detail/caller.hpp(231) :
while compiling class template member function
'boost::python::detail::py_fun
c_sig_info boost::python::detail::caller_arity<2>::im
pl<F,Policies,Sig>::signature(void)'
with
[
F=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
Policies=boost::python::return_internal_reference<>,
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/detail/caller.hpp(169) : see
reference to class template instantiation 'boost::python::detail::caller_
arity<2>::impl<F,Policies,Sig>' being compiled
with
[
F=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
Policies=boost::python::return_internal_reference<>,
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/make_function.hpp(61) : see
reference to class template instantiation 'boost::python::detail::caller<F
,CallPolicies,Sig>' being compiled
with
[
F=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
CallPolicies=boost::python::return_internal_reference<>,
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/make_function.hpp(146) : see
reference to function template instantiation 'boost::python::api::object
boost::python::detail::make_function_aux<F,CallPolicies,Signature,boost::mpl::int_<N>>(F,const
CallPolicies &,const Sig &,const boost::python::detail:
:keyword_range &,NumKeywords)' being compiled
with
[
F=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
CallPolicies=boost::python::return_internal_reference<>,
Signature=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>,
N=1,
Sig=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>,
NumKeywords=boost::mpl::int_<1>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/class.hpp(544) : see
reference to function template instantiation 'boost::python::api::object
boost::p
ython::make_function<Fn,T2,T1,boost::mpl::vector3<T0,pyplusplus::containers::static_sized::array_1_t<TItemType,size>
&,unsigned long>>(F,const CallPol
icies &,const Keywords &,const Signature &)' being compiled
with
[
Fn=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
T2=boost::python::return_internal_reference<>,
T1=boost::python::detail::keywords<1>,
T0=double *const ,
TItemType=double *,
size=4,
F=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
CallPolicies=boost::python::return_internal_reference<>,
Keywords=boost::python::detail::keywords<1>,
Signature=boost::mpl::vector3<double *const
,pyplusplus::containers::static_sized::array_1_t<double *,4> &,unsigned
long>
]
C:\PROGRA~1\boost\BOOST_~1\boost/python/class.hpp(259) : see
reference to function template instantiation 'void
boost::python::class_<W>::def_
impl<pyplusplus::containers::static_sized::array_1_t<TItemType,size>,Fn,boost::python::detail::def_helper<T1,T2>>(T
*,const char *,Fn,const Helper &,.
..)' being compiled
with
[
W=wrapper_t,
TItemType=double *,
size=4,
Fn=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
T1=boost::python::detail::keywords<1>,
T2=boost::python::return_internal_reference<>,
T=pyplusplus::containers::static_sized::array_1_t<double *,4>,
Helper=boost::python::detail::def_helper<boost::python::detail::keywords<1>,boost::python::return_internal_reference<>>
]
c:\program
files\boost\boost_1_35_0\libs\python\example\quickstart\__array_1.pypp.hpp(164)
: see reference to function template instantiation
'boost::python::class_<W> &boost::python::class_<W>::def<double*const
(__thiscall
pyplusplus::containers::static_sized::array_1_t<TItemType,size>::* )
(unsigned long)
const,boost::python::detail::keywords<1>,boost::python::return_internal_reference<>>(const
char *,Fn,const A1 &,const A2 &)' being com
piled
with
[
W=wrapper_t,
TItemType=double *,
size=4,
Fn=double *const (__thiscall
pyplusplus::containers::static_sized::array_1_t<double *,4>::* )(unsigned
long) const,
A1=boost::python::detail::keywords<1>,
A2=boost::python::return_internal_reference<>
]
c:\program
files\boost\boost_1_35_0\libs\python\example\quickstart\__array_1.pypp.hpp(157)
: while compiling class template member function 'p
yplusplus::containers::static_sized::register_array_1<TItemType,size,CallPolicies>::register_array_1(const
char *)'
with
[
TItemType=double *,
size=4,
CallPolicies=boost::python::return_internal_reference<>
]
extending.cpp(100) : see reference to class template instantiation
'pyplusplus::containers::static_sized::register_array_1<TItemType,size,Call
Policies>' being compiled
with
[
TItemType=double *,
size=4,
CallPolicies=boost::python::return_internal_reference<>
]
call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
>nul
cl /Zm800 -nologo
@"bin\msvc-9.0express\debug\threading-multi\extending.obj.rsp"
...failed compile-c-c++
bin\msvc-9.0express\debug\threading-multi\extending.obj...
...removing bin\msvc-9.0express\debug\threading-multi\extending.obj
...skipped <pbin\msvc-9.0express\debug\threading-multi>extending.pyd for
lack of <pbin\msvc-9.0express\debug\threading-multi>extending.obj...
...skipped <pbin\msvc-9.0express\debug\threading-multi>extending.lib for
lack of <pbin\msvc-9.0express\debug\threading-multi>extending.obj...
...failed updating 1 target...
...skipped 2 targets...
The C++ code involved in most of that template stuff is well beyond my
understanding and after a half day of digging through it I have no idea what
is going wrong.
|