2
我真的有一個很難使用ctypes的的Python的ctypes調用簡單的C++ DLL
以下調用從蟒蛇一個簡單的C++ DLL是我的C++代碼:
#ifdef __cplusplus
extern "C"{
#endif
__declspec(dllexport) char const* greet()
{
return "hello, world";
}
#ifdef __cplusplus
}
#endif
...
我的Python代碼:
import ctypes
testlib = ctypes.CDLL("CpLib.dll");
print testlib.greet();
當我運行我的py腳本,我得到這個奇怪的返回值-97902232
請協助。
哎呀...謝謝你:) –