python 调用动态链接库求助
C++ dll代码:extern "C" int __stdcall test();
int __stdcall test()
{
return 1;
}
python调用代码:
>>> from ctypes import*
>>> dll = CDLL("D:\\INetWork.dll")
>>> i = dll.test
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
i = dll.test
File "C:\Python31\lib\ctypes\__init__.py", line 363, in __getattr__
func = self.__getitem__(name)
File "C:\Python31\lib\ctypes\__init__.py", line 368, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'test' not found
>>>
接触python 2个星期了 想自己写程序实验下
总是找不到test函数是为什么?
我用的python版本是3.1