Let me tell you why you are here. You have come because you know something. What you know you can't explain but you feel it. You've felt it your whole life, felt that something is wrong with the world. You don't know what, but it's there like a splinter in your mind, driving you mad. It is this feeling that brought you to me. Do you know what I'm talking about?
10/31/2007
LNK2028, LNK2019 without extern "C"
I wrote a Win32 dll in VS2005 and a CLR-Console client, the CLR-Console client is the caller of Win32 dll. In the Win32 dll, using /TC compiler option to build it and using /clr option to build the CLR-Console client. The all things is fine, such as 'dllexport/dllimport', 'Additional Include Deirectories' and 'Additional Dependencies'. But I got LNK2028 unresolved token and LNK2019 unresolved external symbol, the reason is I forgot using the extern "C" to include all dllexport functions.
please help me to explain why my progamme create a lnk2019 error, the programme is following:
ReplyDelete//*************************
test error LNK2019: unresolved external symbol _SetURL@8 referenced in function _main
//*************************
extern "C" __declspec( dllexport ) void WINAPI SetURL(LPCTSTR lpctstrURL, LPCTSTR lpctstrPORT)
{...}
memo: dll file compiled with the compiler using /clr option
please help me, i wait for your reply, contact me with: yyh9186@hotmail.com, thank you!