Hi,
I'm building my x64 application with PSDK ( in "Win Svr 2003 x64 Build Env" console) and make file, without any VS IDE.
Some applications are sucessfully built and running on x64 Win XP.
Somehow, two kinds of linking errors always happen in a MFC application.
I try to use /VERBOSE:LIB, /NODEFAULTLIB to analyze and re-arrange lib order, but it doesn't help. Many different linking options are also tested, it's still helpless.
The following linking errors come from a static-link make file. Actually, both dynamic and static link also have the same problem.
I'm trapped here.![]()
Why it can't link MFC lib
Can anyone help me any hint any suggestion
Thanks a lot!!
GoPrior
Type I:
==============================================================
uafxcw.lib(wingdi.obj) : error LNK2005: "public: void __cdecl CWnd:
creenToClient(struct tagRECT *)const " ( ScreenToClient@CWnd@@QEBAXPEAUtagRECT@@@Z) already defined in cmnsrc_CustAtvAct.obj
uafxcw.lib(wincore.obj) : error LNK2005: "protected: void __cdecl CWnd:
nSetFocus(class CWnd *)" ( OnSetFocus@CWnd@@IEAAXPEAV1@@Z) already defined in cnt_MyProper.obj
uafxcw.lib(wincore.obj) : error LNK2005: "protected: void __cdecl CWnd:
nPaint(void)" ( OnPaint@CWnd@@IEAAXXZ) already defined in cnt_VlList.obj
uafxcw.lib(dlgfile.obj) : error LNK2005: "public: virtual __cdecl CFileDialog::~CFileDialog(void)" ( 1CFileDialog@@UEAA@XZ) already defined in cnt_FolderDialog.obj
Type II: actually, there are more than 64 errors
==================================================================
cnt_VlVirus.obj : error LNK2001: unresolved external symbol "unsigned short const * const _afxPchNil" ( _afxPchNil@@3PEBGEB)
cnt_ViewLog.obj : error LNK2001: unresolved external symbol "unsigned short const * const _afxPchNil" ( _afxPchNil@@3PEBGEB)
cmnsrc_ComboListCtrl.obj : error LNK2019: unresolved external symbol "public: int __cdecl CStatic::Create(unsigned short const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int)" ( Create@CStatic@@QEAAHPEBGKAEBUtagRECT@@PEAVCWnd@@I@Z) referenced in function "protected: virtual void __cdecl CComboListCtrl:
reSubclassWindow(void)" ( PreSubclassWindow@CComboListCtrl@@MEAAXXZ)
cnt_ProxySettingDlg.obj : error LNK2001: unresolved external symbol "public: int __cdecl CString::LoadStringW(unsigned int)" ( LoadStringW@CString@@QEAAHI@Z)
cnt_ScanDlg.obj : error LNK2001: unresolved external symbol "public: int __cdecl CString::LoadStringW(unsigned int)" ( LoadStringW@CString@@QEAAHI@Z)
cnt_ViewLog.obj : error LNK2001: unresolved external symbol "public: __cdecl CString::~CString(void)" ( 1CString@@QEAA@XZ)
cnt_OptManu.obj : error LNK2001: unresolved external symbol "public: void __cdecl CWnd::GetWindowTextW(class CString &
const " ( GetWindowTextW@CWnd@@QEBAXAEAVCString@@@Z)

[Need help] linking error for Platform SDK Server 2003 SP1 build 1289
p030037
I had the same uafxcwd.lib problem. Solved adding /NODEFAULTLIB:"uafxcwd.lib" to the linker command line
And try to compile with VStudio 2005.
Bimlesh
Install the latest 64SDK(1433), it should resolve many of your linking errors. ScreenToClient and some of other methods again can give you the liking errors in that case use the Win32 API instead of MFC methods.
e.g.
In place of screentoclient you can use win32 api
:
Regards,
-Kishore Wani
fhunter
I downloaded the latest PSDK 5.2.3790.1830.15 and it worked fine.
Every linking error was gone except ScreenToClient().
That' great... I am free...
Thanks for your help!!
Regars,
GoPrior