As mrTAToad said, you need to export your functions. I prefer the following way. I have tested and compiled under Dev-C++5(gcc2.95).
#include <windows.h>
#include <stdio.h>
#define EXPORT __declspec(dllexport)
EXPORT int testing(int a,int b) {
return a+b;
}
BOOL APIENTRY
DllMain (
HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
And here is the test code
a as integer
b as integer
c as integer
a=1
b=2
load dll "Project1.dll", 1
c=call dll(1, "testing__Fii", a, b)
delete dll 1
print c
sync
wait key
Enjoy!