[C++-sig] Boost function call error

Dirgesh Patel dirgesh.patel at hp.com
Wed Sep 7 23:22:52 CEST 2005


i am trying to wrap this function

bkimage* copy(bkimage *img, xint32_t pln0, xint32_t row0, xint32_t col0, 
xint32_t pln1, xint32_t row1, xint32_t col1)

and this is the line in the boost.cpp file
    def("copy", static_cast<bkimage* 
(*)(bkimage*,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy()) 
[return_value_policy<manage_new_object>() ]);


and i get this error:
../python/imageMorph_boost.cpp: In function `void init_module_imageMorph()':
../python/imageMorph_boost.cpp:107: error: invalid static_cast from type 
`imageMorph_copy' to type `bkimage*(*)(bkimage*, xint32_t, xint32_t, 
xint32_t, xint32_t, xint32_t, xint32_t)'

we are trying to return a ptr to bkimage. please advice.

thanks
dirgesh




"Mike Rovner" <mrovner at propel.com> wrote in message 
news:deisg2$u5c$1 at sea.gmane.org...
> Dirgesh Patel wrote:
>> i get the same error..i was told you have to cast the function name to a 
>> ptr
>> and can't use (&)
>
> right, delete one extra pointer then:
>
> def("copy", static_cast<bkimage
>  (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>
>   (imageMorph_copy),
> return_value_policy<manage_new_object>() ); 






More information about the Cplusplus-sig mailing list