This works fine on Windows 7 with Python 2.7:
lib = ctypes.cdll.LoadLibrary('prov_means')
provmeans = lib.provmeans
The library prov_means.DLL is in my working directory. It exports a simple, stand-alone C function provmeans() with no dependencies.
When I try the same thing on Windows XP and Python 2.7 I get
Traceback (most recent call last):
File "D:pythonAuxilsrcauxil.py", line 130, in <module>
lib = ctypes.cdll.LoadLibrary('prov_means')
File "C:Python27libctypes\__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "C:Python27libctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
I have tried copying the DLL to WindowsSystem32 and also entering the full path name
"d:\python\auxil\src\prov_means"
with and without the ".DLL" extension. Nothing works.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…