I have a VS solution with an executable and a DLL.
In the executable (MAIN):
__declspec(dllexport) void testExe()
{
printf("Hello from EXE");
}
__declspec(dllimport) void DoStuff();
int main()
{
DoStuff();
}
while in the .dll (DLL)
__declspec(dllimport) void testExe();
__declspec(dllexport) void testDll()
{
printf("Hello from Dll");
}
__declspec(dllexport) void DoStuff()
{
testExe();
testDll();
}
I linked Dll.lib in MAIN.exe, but I still get a linking error:
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl testExe(void)" referenced in function "void __cdecl DoStuff(void)"
How can I achieve this?