none
unresolved external symbol __CxxFrameHandler3 or __ArrayUnwind

    Question

  • I am building my application targeted for the PocketPC platform. The app builds for Win32 fine.

    I get one linker error when I build now:

    LIBCMTD.lib(ehvccctr_ce.obj) : error LNK2005: "void __cdecl __ArrayUnwind(void *,unsigned int,int,void (__cdecl*)(void *))" (?__ArrayUnwind@@YAXPAXIHP6AX0@Z@Z) already defined in ccrtrtti.lib(ehvecdtr.obj)

    If I remove the LIBCMTD.lib by adding it to the ignore libraries, then I get this error:

    IconWin.obj : error LNK2001: unresolved external symbol __CxxFrameHandler3

    (>280 times for different modules)

    plus one other error:

    tSkinnedWindow.obj : error LNK2019: unresolved external symbol "void __cdecl `eh vector copy constructor iterator'(void *,void *,unsigned int,int,void (__cdecl*)(void *,void *),void (__cdecl*)(void *))" (??__C@YAXPAX0IHP6AX00@ZP6AX0@Z@Z) referenced in function "public: __cdecl tSkinElement::tSkinElement(class tSkinElement const &)" (??0tSkinElement@@QAA@ABV0@@Z)

    Any ideas?

    Thanks...

     

    Thursday, January 26, 2006 3:21 PM

Answers

  • I will post the problems to the feedback center.

    The workaround for the linker error is to not pass the class that contains an array of classes with copy constructors by value. I pass them by reference and it is okay.

    The main problem is finding who is causing the linker error because it doesn't reference any module or class associated with the problem.

    Thanks, Aaron

    Thursday, February 02, 2006 7:15 PM

All replies

  • __CxxFrameHandler3 is defined in libcpmt.lib, which is the C++ Standard Library. Can you check to see if you have this in your ignore import libraries as well? I believe it should be pulled in via #pragma by default. I suspect the other error is from this as well. Thanks,

    Jeff Abraham
    Visual Studio

    Thursday, January 26, 2006 10:45 PM
  • I tried adding the libcpmt.lib library to my additional dependencies on the linker options, but it didn't change anything. The only things I am ignoring are the libc.lib and libcd.lib (in the StdAfx.h w/ a pragma) and the libcmtd.lib in the linker options to prevent the multiple __ArrayUnwind error. With the libcpmt.lib I get the same __CxxFrameHandler3 errors.

    From the CE5.0 sources I copied the functions that were still needed for link from the RTTI library, namely void HELPERFNAPI __ehvec_ctor, void HELPERFNAPI __ehvec_dtor, and the typeinfo class, to one of my modules. So then everything linked properly (granted, this is NOT how I should have to do it) but it won't run. I can run a small test app the wizard generated, but when I run my large ported app, MS Visual Studio pops up an error box (after a ~8 second download) that says "Unable to start program '%CSIDL_PROGRAM_FILES%\Blue\HenryJr_Debug.exe'."

    Now what. I have no way to debug the problem... The only way to figure it out will be to start adding chunks of my app to a wizard generated app one at a time, but this takes forever because for each pass I will have to get everything compliling and linking w/o the rest of it.

    Friday, January 27, 2006 5:31 PM
  • Okay, I'm not surprised that copying the functions didn't work. Can you add /showIncludes to the compiler command line, and /verbose to the linker command line, and see if that generates any useful information for you? The linker /verbose option should show you why libs are being pulled in, and from where (ditto header files for /showIncludes) and should help to track this down. The fact that you have multiple __ArrayUnwind definition errors is weird, and suggests that you are mixing CRT/Std C++ Lib functions, which may be confusing the linker and causing it to discard another library. Hope this helps,

    Jeff

    Friday, January 27, 2006 5:46 PM
  • I turned on the options you mentioned and tried to copy the resulting list from the output window to the clipboard and the debugger warned me about reduced performance, I said ok, and then it exited... Trying again.

    Arrgghh... It apparently deleted the project file on its way out or never saved it?! Reverting to source safe copy and re-converting from 2003 now...

     

    Friday, January 27, 2006 6:21 PM
  • Sorry about the lost work, usually we prompt to save the project file before doing anything, but apparently you found a corner case where we don't think it's out of date.

    Jeff

    Friday, January 27, 2006 6:53 PM
  • Another note for your conversion people... The debug information format on the C/C++ options isn't coverting correctly (just says 4 after conversion) and so when I choose compile, it just gives an error "Blue : error PRJ0004 : Could not generate command line for the 'VCCLCompilerTool' tool."

    Still working on gettings things re-converted... Uh.... it just crashed unexpectedly and I have a 0 byte .vcproj file again. I explicitly saved after the conversion....

    Converting again - not sure what to do if it never saves the file. All the other projects in the solution worked okay...

    Friday, January 27, 2006 7:13 PM
  • Ok. Here is the compiler issue (bug?) causing my linker problem. This took a while to run down in our very large project... BTW, HTML inserting a linefeed between every line is annoying.

    I created a simple smart device MFC application (I was tyring to figure out how to make the program run full screen (cover the start menu)... how?!). This code works when targeting the PC, but gives the linker error on the Pocket PC ARMV4 target build:

    1>LIBCMTD.lib(ehvccctr_ce.obj) : error LNK2005: "void __cdecl __ArrayUnwind(void *,unsigned int,int,void (__cdecl*)(void *))" (?__ArrayUnwind@@YAXPAXIHP6AX0@Z@Z) already defined in ccrtrtti.lib(ehvecdtr.obj)

     

     

    class tTestClass1

    {

    public:

    tTestClass1()

    {

    }

    tTestClass1(const tTestClass1 &Test)

    {

    }

    ~tTestClass1()

    {

    }

    };

    class tTestClass2

    {

    public:

    tTestClass1 Array[1];

    };

    class tTestClass3

    {

    public:

    void Function1(tTestClass2 Class2)

    {

    }

    };

     

    // The one and only CFullScreenApp object

    CFullScreenApp theApp;

    // CFullScreenApp initialization

    BOOL CFullScreenApp::InitInstance()

    {

    tTestClass2 Class2;

    tTestClass3 Class3;

    Class3.Function1(Class2);

     

    // SHInitExtraControls should be called once during your application's initialization to initialize any

    // of the Windows Mobile specific controls such as CAPEDIT and SIPPREF.

    SHInitExtraControls();

    // Standard initialization

    // If you are not using these features and wish to reduce the size

    // of your final executable, you should remove from the following

    // the specific initialization routines you do not need

    // Change the registry key under which our settings are stored

    // TODO: You should modify this string to be something appropriate

    // such as the name of your company or organization

    SetRegistryKey(_T("Local AppWizard-Generated Applications"));

    // To create the main window, this code creates a new frame window

    // object and then sets it as the application's main window object

    CMainFrame* pFrame = new CMainFrame;

    if (!pFrame)

    return FALSE;

    m_pMainWnd = pFrame;

    // create and load the frame with its resources

    pFrame->LoadFrame(IDR_MAINFRAME,

    WS_MAXIMIZE | FWS_ADDTOTITLE, NULL, NULL);

     

    // The one and only window has been initialized, so show and update it

    pFrame->ShowWindow(SW_SHOW);

    // pFrame->WindowState = WS_MAXIMIZE;

    pFrame->UpdateWindow();

    return TRUE;

    }

     

    Thursday, February 02, 2006 3:44 PM
  • Sorry to not have better advice for you here, but can you log a bug at the feedback center? At the very least, we should convert debug information format entries properly, and we shouldn't erase the project file in this case. Are you still stuck on this dup definition linker error, or have you been able to work around it at this point?

    Jeff

    Thursday, February 02, 2006 6:38 PM
  • I will post the problems to the feedback center.

    The workaround for the linker error is to not pass the class that contains an array of classes with copy constructors by value. I pass them by reference and it is okay.

    The main problem is finding who is causing the linker error because it doesn't reference any module or class associated with the problem.

    Thanks, Aaron

    Thursday, February 02, 2006 7:15 PM
  • Hi

    Can anyone provide any more information about this problem?

    I'm seeing several issues currently when trying to link with the libraries from the WM5 Server Components (HTTPD, UPNP, etc)

    These issues seem to be similar to those reported here - they seem to be compiler/linker related.

     error LNK2001: unresolved external symbol memcpy_s

    error LNK2001: unresolved external symbol __CxxFrameHandler3

    unresolved external symbol "class ATL::CComModule _Module" (?_Module@@3VCComModule@ATL@@A)

    So far I've failed to get the WM5 Server components to link with anything using VS2005.... so any hints on this will be gratefully accepted

    Stuart

     

    Friday, March 03, 2006 4:51 PM
  • Does anybody now the way how to separate libraries wich reference some simbols from libraries wich contain it's implementation?
    Saturday, May 06, 2006 4:57 AM
  • Did you ever resolve the __CxxFrameHandler3 and memcpy_s unresolved symbols?

    I have an identical problem and no solutions on MSDN or other forums.

    Thanks
    Wednesday, August 09, 2006 4:35 PM
  • For sure

    I'm also having the following unresolved externals

      __CxxFrameHandler3

      __except_handler4

     __load_config_used

    For the __CxxFrameHandler3, I have found this page of information

    http://www.adras.com/Using-VS2005-to-ship-legacy-code-for-XP-and-Windows-2000.t6558-27.html

    So, I implemented the following in my device SDK.

    I have not tested this fix since I need to resolve the two other unresolved externals.

    Anyone can help me figure out the problem for __except_handler4 and __load_config_used?

    ///////////////////////////////////////////////////////////////////////////////////
    //
    // Name         : __CxxFrameHandler3
    //
    // Synopsis     : __CxxFrameHandler3 not available in CE 5.0 SDK
    //                     To support VS2005 compilation, we pass back call to __CxxFrameHandler
    //
    // Parameters   :
    //
    // Returns      :
    //
    ///////////////////////////////////////////////////////////////////////////////////
    extern "C" void *__CxxFrameHandler;
    extern "C" void  __declspec(naked) __CxxFrameHandler3(void)
        {
        // Jump indirect: Jumps to __CxxFrameHandler
        _asm jmp __CxxFrameHandler ; Trampoline bounce
        }

    Wednesday, August 23, 2006 9:02 PM
  • Your problem is probably due to the lack of an exported symbol in the Microsoft C++ library.  If I remember right this was a problem with VC7.  VC8 fixes this issue.  If you are still stuck on VC7 try installing the Platform SDK as the libraries in there will fix your issue.
    Friday, May 11, 2007 6:48 PM
  • For __except_handler4 try to include the RunTmChk.lib from VS2005
    Tuesday, June 26, 2007 2:40 PM
  • Hi, I have two VS installed on my computer ( 7 and 8), and I had this error today - some unresolved external symbols, include __CxxFrameHandler3, this was in VS2003. After I have opened the same project in VS2005 all error disappeared.
    Friday, November 09, 2007 12:22 PM