1
不同的目录.dll文件加载时,我有以下目录结构:错误从使用python ctypes.CDLL()
MainProject
| ...project files
| rtlsdr\
| | rtlsdr.dll
| | ...other .dll's etc.
我使用的功能CDLL()库ctypes的到加载rtlsdr.dll
。它正常工作时,我的工作目录是rtlsdr\
:
$ cd rtlsdr
$ python
> from ctypes import *
> d = CDLL('rtlsdr.dll')
然而,当我尝试从另一个目录中加载文件:
$ cd MainProject
$ python
> from ctypes import *
> d = CDLL('rtlsdr\\rtlsdr.dll')
我得到一个错误:
WindowsError: [Error 126] The specified module could not be found.
什么这里是问题吗?
可能的复制|访问DLL使用ctypes](http://stackoverflow.com/questions/7586504/python-accessing-dll-using-ctypes) – eryksun