BUG: You receive a linker error message when you build an Itanium architecture-based application (833981)
The information in this article applies to:
- Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
- Microsoft Windows Server 2003, Datacenter Edition for Itanium-based Systems
- Microsoft Windows XP 64-Bit Edition Version 2003
- Microsoft Windows XP 64-Bit Edition Version 2002
SYMPTOMSWhen
you build an Itanium architecture-based application that uses Microsoft Foundation
Classes (MFC) headers, you may receive the following linker error message:
libcmtd.lib(dbgnew.obj) : error LNK2005: "void * __cdecl
operator new(unsigned __int64,int,char const *,int)" (??2@YAPEAX_KHPEBDH@Z)
already defined in nafxcwd.lib(afxmem.obj)
libcmtd.lib(dbgnew.obj) :
error LNK2005: "[Entry] void * __cdecl operator new(unsigned __int64,int,char
const *,int)" (.??2@YAPEAX_KHPEBDH@Z) already defined in
nafxcwd.lib(afxmem.obj)
Q833981.exe : fatal error LNK1169: one or
more multiply defined symbols found When you use the UndName tool
on the decorated name ??2@YAPEAX_KHPEBDH@Z, you receive the
following output: Microsoft (R) C++ Name
Undecorator Copyright (C) Microsoft Corporation 1981-2001. All rights
reserved. Undecoration of :- "??2@YAPEAX_KHPEBDH@Z" is :- "void * __ptr64
__cdecl operator new(unsigned __int64,int,char const *
__ptr64,int)" WORKAROUNDTo work around this problem, define the operators in your
application. #ifdef _DEBUG
void* operator new[](size_t nSize, LPCSTR lpszFileName, int nLine) {
return ::operator new[](nSize, _NORMAL_BLOCK, lpszFileName, nLine); }
void* operator new[](size_t nSize, int nType, LPCSTR lpszFileName, int nLine) {
return ::operator new(nSize, nType, lpszFileName, nLine);
}
#endif STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbCompiler kbSDK kbcode kberrmsg KB833981 kbAudDeveloper |
---|
|