for example I have a C++ variable declaration and function like this(assume its a dll function)
int img_width, img_height, stride;
somefunction(&img_width, &img_height, &stride)
{
....
}
same thing how can we do using python ctypes?
I tried in the following way
img_width, img_height, stride = c.POINTER(c_int), c.POINTER(c_int), c.POINTER(c_int) dll.somefunction(img_width, img_height, stride)
which resulted the following exception
ctypes.ArgumentError: argument 1: : Don't know how to convert parameter 1)
I also tried in following way
dll.somefunction.restype = c.c_void_p dll.somefunction.argtypes = [c.POINTER(c_int), c.POINTER(c_int), c.POINTER(c_int)] dll.somefunction(img_width, img_height, stride)
Where I endup with following exception
NameError: global name 'img_width' is not defined