Skip to content

Fixing that ‘___destroy_new_array’/’___CxxFrameHandler’ linker error..



After a very quiet June am back with some posts.
Recently while building one of the components I was harassed by a silly linker error.The error message spewed was this :

     mwldsym2.exe: Undefined symbol: '___CxxFrameHandler'

     mwldsym2.exe: referenced from 'void CAllocator::AddStopper(class MOOMStopper*) (?AddStopper at CAllocator@@QAEXPAVMOOMStopper@@@Z)' in Allocator.cpp:92

     mwldsym2.exe: referenced from 'void * CBase::operator new(unsigned int)(??2CBase@@SAPAXI at Z)' in e32base.inl:36

     mwldsym2.exe: referenced from 'class CAllocator * Allocator(void)(?Allocator@@YAPAVCAllocator@@XZ)' in MemoryManager.cpp:92

     mwldsym2.exe: referenced from 'void invokeTable(void (* *)(void), void (**)(void)) (?invokeTable@@YAXPAP6AXXZ0 at Z)' in win32crt.h:121 (EDLL.LIB)

     mwldsym2.exe: referenced from 'void * operator new(unsigned int)(??2 at YAPAXI@Z)' in win32crt.h:154 (EDLL.LIB)

     mwldsym2.exe: referenced from 'void operator delete(void *) (??3 at YAXPAX@Z)'in win32crt.h:176 (EDLL.LIB)

     mwldsym2.exe: referenced from '__E32Dll' in uc_dll.cpp:41 (EDLL.LIB)

     mwldsym2.exe: referenced from 'CStopScheduler::CStopScheduler(classCAllocator &) (??0CStopScheduler@@QAE at AAVCAllocator@@@Z)' in StopScheduler.cpp:59

     mwldsym2.exe: Undefined symbol: '___destroy_new_array'

     mwldsym2.exe: referenced from 'CPlainAllocator::~CPlainAllocator(unsigned int) (??_ECPlainAllocator@@UAE at I@Z)' in MemoryManager.o

     mwldsym2.exe: referenced from 'CStopScheduler::~CStopScheduler(unsigned int) (??_ECStopScheduler@@UAE at I@Z)' in Allocator.o

     mwldsym2.exe: referenced from 'CAllocator::~CAllocator(unsigned int) (??_ECAllocator@@UAE at I@Z)' in MemoryManager.o

     mwldsym2.exe: Undefined symbol: '___unexpected'

     mwldsym2.exe: referenced from 'void operator delete(void *) (??3 at YAXPAX@Z)' in win32crt.h:176 (EDLL.LIB)

     mwldsym2.exe: referenced from 'void * CBase::operator new(unsigned int) (??2CBase@@SAPAXI at Z)' in e32base.inl:36

Well as straightforward as it may seem, I took a full day to fix this error.
So if you are also facing this error, the fix can be one of these:

  • The PATH environment variable must have exceeded 1024 characters.So just check the variable and remove duplicate entries and try to compress long entries using the DOS 8.3 format.
  • The library in question is the MSL_All_MSE_Symbian_D.lib ,so just find its path and make sure that your linker finds it.
  • Also in case of CodeWarrior the above mentioned task would be done by the env_update.exe, which can be found in the /bin folder of you Nokia Codewarrior installation.

Hope this saves the time I wasted on fixing this silly error.