Hi,
I have a FuncA() inside the EXE. FuncA() is called from inside the EXE and from inside a DLL. Therefore, I wrote a callback function for FuncA() so that the DLL can call to it. Hence, I need to export FuncA() so that I can get the function address from inside the DLL.
Code:
declspec(dllexport) void FuncA(){ return; }//declspec(dllexport) is to be able to get the function address.
However,
Because FuncA() is called from DLL AND from inside the EXE as well,
my problem is the declaration of funcA() inside the EXE. That declaration will be used by the functions inside the EXE.
Code:
void FuncA();//If I write it this way I get the following error:
error C2375: 'FuncA' : redefinition; different linkage
And,
Code:
declspec(dllimport) void FuncA();//If I write it this way, I get the following warning and the program hangs.
warning LNK4049: locally defined symbol _FuncA imported
How do I write the proper declaration?
Note: Windows, Visual Studio 2008, Standard-C