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