I want to test wrapping a dll with ctypes. I've written the following test code and compiled it using Code::Blocks and Cygwin to a dll.
#define DLL_EXPORT extern "C" __declspec(dllexport) DLL_EXPORT int sum(int a, int b) { return a + b; } Note: This is the whole code. Maybe there is something missing ?
Now, I copy the TestDll.dll to my Desktop and start the Python interpreter. But when I want to load it, the interpreter just exits !
C:\Users\niklas\Desktop>python Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> dll = ctypes.WinDLL('TestDll') C:\Users\niklas\Desktop> However, loading any other library works, or giving an error if the library could not be found.
Can you tell me what I'm doing wrong here ?
Using Cygwin g++ 3.4.4