+ -
当前位置:首页 → 问答吧 → 弱弱的问题

弱弱的问题

时间:2011-02-12

来源:互联网

我用ctypes库调用自己用C编写的一个DLL,输出函数如下图:
下载 (25.14 KB)
2011-02-12 09:58

python调用的语句为:

IDLE 1.1.2      
>>> from ctypes import *
>>> add = cdll.LoadLibrary('d1a.dll')
>>> add.add(1,2)

显示的错误信息为:
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in -toplevel-
    add.add(1,2)
  File "d:\programfiles\phoenix integration\analysis server 6.02\python\lib\site-packages\ctypes-1.0.2-py2.4-win32.egg\ctypes\__init__.py", line 353, in __getattr__
    func = self.__getitem__(name)
  File "d:\programfiles\phoenix integration\analysis server 6.02\python\lib\site-packages\ctypes-1.0.2-py2.4-win32.egg\ctypes\__init__.py", line 358, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'add' not found

请大牛们指点解决办法

作者: supermenxp   发布时间: 2011-02-12

问题已经解决!

作者: supermenxp   发布时间: 2011-02-12

热门下载

更多