Hi. I'm trying to create a very simple dll with Pelles C using the wizard. I start by going to File > New > Project > Empty projects > Win32 Dynamic library (DLL). I then create a file named "main.c", and here's my sourcecode:
#include <stdio.h>
int hello(int var)
{
return 5 * var;
}
I want to access my dll from python as such:
from ctypes import *
test = cdll.LoadLibrary("helloDLL.dll")
print(test.hello(5))
The return result should be 25.
When I compile the code using gcc as follows, the DLL works:
gcc -c main.c
gcc -shared -o helloDLL.dll main.o
However, when I build with Pelles C, the function cannot be found.
What am I doing wrong? I'm just about to pull out my hair. Please help. Thanks.