I have a C++ application needs to have a Python wrapper using ctypes.
There are many classes and their member functions were preceded by class
names and scope resolution scope "::".
Does anybody know how to access their member functions using ctypes.
For example, one of the classes X and its member function is
extern "C" {
void X::init(char*) {
.....
}
}
After the shared library is created, how to call X::init(...) in ctypes ?
Here is what I meant in python snippet below, it gave me error something like "undefined symbol init(), because I need to have class X specified but do not know how.
s = 'name'
lib = CDLL('./test.so')
lib.init.argtypes = c_char_p
lib.init.restype = None
lib.init(s)
Thanks.