Boost logo

Boost Users :

From: michael_gruner_at_[hidden]
Date: 2006-08-03 10:31:31


Hello,

I'm trying to use boost.python to wrap a C function that takes a pointer on a void pointer as an argument. But I'm going wrong to use the example from the FAQ. Could anyone help me on this?

my code looks like this:

struct void_;
BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(void_);

int myfunc(char * mychar, void ** mypointer);

int myfunc_wrp(char * mychar, void_ ** mypointer){
        return myfunc(mychar,(void ** ) mypointer);
}

...

BOOST_PYTHON_MODULE(mymodule){

        def("myfunc", &myfunc_wrp);
}

later in python I do:

import mymodule

mystring = " "
mypointerobject = 0

mymodule.myfunc(mystring,mypointerobject)

and get:
Boost.Python.ArgumentError: Python argument types in mymodule.myfunc(str, int)
did not match C++ signature:
        myfunc(char *, struct void_ * *)

Are there any advices to solve this problem?

thank you for your answers.

Kind regards,

Michael


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net