背景:c++自定义创建dll,依赖于gda201.dll(如何创建dll的部分略),并提供给python调用
Objdll = ctypes.cdll.LoadLibrary('D:\\ge\\testDLL\\x64\\Debug\\testDLL.dll') # 此处建议绝对路径
报错信息:
Traceback (most recent call last):
File "E:\PyCharm 2017.3.4\helpers\pydev\pydev_run_in_console.py", line 53, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "E:\PyCharm 2017.3.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/ProJect/PyCharm/DataPrepare/testDLL.py", line 7, in <module>
Objdll = ctypes.cdll.LoadLibrary('D:\\ge\\testDLL\\x64\\Debug\\testDLL.dll')
File "C:\Python36\lib\ctypes\__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "C:\Python36\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。
很显然,错误的原因在于