Hello I am trying to create a C wrapper function for Python but I am having some trouble.
This is a simple test case that reproduces the problem. All the C function does is print the string given to it.
import ctypes
def test(hi):
fun = ctypes.CDLL(r"\cygwin64\home\User\test\test.so")
fun.print.argtypes = [ctype.c_char_p]
fun.print(hi)
test("pizza")
The error message I get is.
Traceback (most recent call last):
File "C:\cygwin64\home\CCSS Student\test\kdtw.py", line 25, in <module>
test('pizza')
File "C:\cygwin64\home\CCSS Student\test\kdtw.py", line 19, in test
fun = ctypes.CDLL(r"\cygwin64\home\CCSS Student\test\test.so")
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\ctypes\__init__.py", line >364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
I have tried giving the full path (including drive) and the file name and this file is in the same directory. The C file compiles to the .so file. One note is that I am on Windows which could make a difference.