Tuesday, 3 September 2013

Calling complicated C++ functions in Python (linux)

Calling complicated C++ functions in Python (linux)

I have some functions in C++ source, declared like this:
extern "C" {
int32_t comp_ip_long(const std::vector<EachColumn>& in,
std::vector<EachColumn>& out);
}
The C++ code is compiled into xxx.so (linux shared object) and I want to
call the function in Python. notice that I cannot modify the C++ code, so
something like boost::python is not accessable.
I've tried ctypes.CDLL, but I don't know how to pass the complicated
argument to xxx.so?

No comments:

Post a Comment