I created a little example in C, maybe that helps someone to understand my problem:
the problem occours as soon as I comment in //appFct(); in dllfct.c
Code:
//dllfct.h
#ifdef BUILD_DLL
// the dll exports
#define EXPORT __declspec(dllexport)
#else
// the exe imports
#define EXPORT __declspec(dllimport)
#endif
#include "hello.h"
// function to be imported/exported
EXPORT void tstfunc (void);
Code:
// dllfct.c
#include <stdio.h>
#include "dllfct.h"
EXPORT void tstfunc (void)
{
//appFct();
printf ("Hello\n");
}
Code:
// hello.h
void appFct();
Code:
// hello.c
#include "dllfct.h"
void appFct()
{
printf("app here\n");
}
int main ()
{
tstfunc ();
return (0);
}
Code:
//build:
gcc -c hello.c
gcc -c -DBUILD_DLL dllfct.c
gcc -shared -o tst.dll dllfct.o // ERROR undefined reference to appFct()
gcc -o out.exe hello.o -L./ -ltst