none
error lnk2028: unresolved token

    Question

  • I'm using VSNET 2005 June CTP. When I create a MFC ActiveX Control and specify common language runtime support, old syntax, I get several error lnk2028: unresolved token messages.

    I have tried the "Remove the Entry Point of the Managed DLL" solution from http://support.microsoft.com/?id=814472
    Thursday, July 14, 2005 3:32 AM

Answers

  • I really though this has already been fixed before. I am suprised it is still in recent builds. I am going to investigate this internally, I have already reactivated corresponding bugs for this issue. You are also welcome to open a bug on lab.msdn.microsoft.com to keep track of this issue. Thanks a lot for bringing this up!

    Nikola
    VC++

    Thursday, July 28, 2005 9:09 PM

All replies

  • Hi,

    This support page does not apply to VS2005. What errors do you see exactly? Could you please post a list of errors?

     

    Thanks,

    Nikola

    Monday, July 18, 2005 5:44 PM
  • Here is the list of warnings and errors:

    Warning 1 warning C4793: 'virtual-call thunks are native with /clr' : causes native code generation for function 'COleControl::`vcall'{496}'' c:\Documents and Settings\jstarnes\Desktop\MyMFCActiveXControl\MyMFCActiveXControlCtrl.cpp 1 

    Error 2 error LNK2028: unresolved token (0A00000B) "struct HINSTANCE__ * __stdcall GetModuleHandleA(char const *)" (?GetModuleHandleA@@$$FYGPAUHINSTANCE__@@PBD@Z) referenced in function "public: __thiscall PostDllMain::PostDllMain(void)" (??0PostDllMain@@$$FQAE@XZ) mfcm80ud.lib 

    Error 3 error LNK2028: unresolved token (0A00000D) "int __stdcall AfxIsModuleDll(void)" (?AfxIsModuleDll@@$$FYGHXZ) referenced in function "public: __thiscall PostDllMain::PostDllMain(void)" (??0PostDllMain@@$$FQAE@XZ) mfcm80ud.lib 

    Error 4 error LNK2028: unresolved token (0A00000E) "int __stdcall AfxInitCurrentStateApp(void)" (?AfxInitCurrentStateApp@@$$FYGHXZ) referenced in function "public: __thiscall PostDllMain::PostDllMain(void)" (??0PostDllMain@@$$FQAE@XZ) mfcm80ud.lib 

    Error 5 error LNK2019: unresolved external symbol "int __stdcall AfxInitCurrentStateApp(void)" (?AfxInitCurrentStateApp@@$$FYGHXZ) referenced in function "public: __thiscall PostDllMain::PostDllMain(void)" (??0PostDllMain@@$$FQAE@XZ) mfcm80ud.lib 

    Error 6 error LNK2019: unresolved external symbol "struct HINSTANCE__ * __stdcall GetModuleHandleA(char const *)" (?GetModuleHandleA@@$$FYGPAUHINSTANCE__@@PBD@Z) referenced in function "public: __thiscall PostDllMain::PostDllMain(void)" (??0PostDllMain@@$$FQAE@XZ) mfcm80ud.lib 

    Error 7 error LNK2019: unresolved external symbol "int __stdcall AfxIsModuleDll(void)" (?AfxIsModuleDll@@$$FYGHXZ) referenced in function "public: __thiscall PostDllMain::PostDllMain(void)" (??0PostDllMain@@$$FQAE@XZ) mfcm80ud.lib 

    Error 8 fatal error LNK1120: 6 unresolved externals C:\Documents and Settings\jstarnes\Desktop\MyMFCActiveXControl\Debug\MyMFCActiveXControl.ocx 
    Tuesday, July 26, 2005 12:51 PM
  • This is know issue in Beta 2. The fix was checked in late in May, so it may not made it to June CTP. This should be a problem with July CTP. Try it with July CTP, if it repros, we definitely need to take a look on this. Please then open a bug on lab.msdn.microsoft.com

    Thanks,
    Nikola
    VC++
    Tuesday, July 26, 2005 8:41 PM
  • Results With July CTP:

    Build Errors and Warnings From Release Configuration:

    Error 1 error LNK2005: _DllGetClassObject@12 already defined in stdafx.obj mfcs80u.lib 

    Error 2 error LNK2005: _DllCanUnloadNow@0 already defined in stdafx.obj mfcs80u.lib 

    Error 3 fatal error LNK1169: one or more multiply defined symbols found C:\Documents and Settings\jstarnes\Desktop\AxUserControl\Release\AxUserControl.ocx 1 

    ===================================================

    Build Errors and Warnings From Debug Configuration:

    Warning 1 warning C4793: 'virtual-call thunks are native with /clr' : causes native code generation for function 'COleControl::`vcall'{496}'' c:\Documents and Settings\jstarnes\Desktop\AxUserControl\AxUserControlCtrl.cpp 1 

    Warning 2 warning LNK4099: PDB 'mfcm80ud.i386.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcm80ud.lib' or at 'c:\documents and settings\jstarnes\desktop\axusercontrol\debug\mfcm80ud.i386.pdb'; linking object as if no debug info mfcm80ud.lib 

    ===================================================

    Also, if you insert the debug version of the control into the ActiveX Control Test Container and then close the application, you will get a debug assertion and some unhandled exceptions.

    Thursday, July 28, 2005 8:05 PM
  • I really though this has already been fixed before. I am suprised it is still in recent builds. I am going to investigate this internally, I have already reactivated corresponding bugs for this issue. You are also welcome to open a bug on lab.msdn.microsoft.com to keep track of this issue. Thanks a lot for bringing this up!

    Nikola
    VC++

    Thursday, July 28, 2005 9:09 PM