I have 2 functions, SendMsg and Main.
I need to declare SendMsg as a dll and Main as a normal win32 console application and then export SendMsg out to Main.
I declare in the following ways:
#define DLLExport __declspec(dllexport)
DLLExport int SendMsg()
// do something
#define DLLImport __declspec(dllimport)
extern DLLImport int SendMsg();
cout<<"sending msg using dll"<<endl;
int results = SendMsg();
I added sendmsg.dll as one of the files in Main for building. And I encountered this problem:
main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl SendMsg(void)" (__imp_?SendMsg@@YAHXZ)
Debug/appa.exe : fatal error LNK1120: 1 unresolved externals
Pls advise what have I missed out?