python file
import ctypes
from numpy.ctypeslib import ndpointer
#lib = ctypes.CDLL("C:\\Users\\Ali\\Desktop\\test9\\a.dll")
lib = ctypes.CDLL("C:\\Users\\Ali\\Desktop\\test9\\a.dll")
#lib.function.restype = ndpointer(dtype=ctypes.c_int, shape=(4000,3),flags='C')
lib.function.restype = ndpointer(dtype=ctypes.c_int, shape=(100000000,3),flags='C')
#
res = lib.function()
print(res)
c file(dll)
int (*function(void))[3] {
clock_t begin = clock();
// allocate an array of 5 arrays of 5 int
int (*information)[3] = malloc(100000000 * sizeof(*information));
// initialize all 5 rows to identical vectors { 0, 1, 2, 3, 4 }
for (int k = 0; k < 100000000; k++) {
for (int j = 0; j < 3; j++) {
information[k][j] = j;
}
}
clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
printf("%f\n", time_spent);
return information;
}
When I try to use the dll it gives me this error even though I'm sure mingw64 is installed
Is my problem from c script? thank you