titanandrews
Programmer
Hello All,
I am having a terrible time during the link step. Here is my scenario:
[ul]
[li]I have written a program that only uses classes from the standard C++ library. It is a console based app.[/li]
[li]Now I want to bolt on a GUI front end to this thing, so I used VS 7.0 to build a simple GUI. [/li]
[li]Both programs compile, link, and execute just fine. [/li]
[li]Now I bring in my classes from the console app into the VS project[/li]
[li]I created a makefile to build everything, but I get tons of linker errors. I have the output below[/li]
[li]Microsoft seems to be a little smarter in building this thing because it can build it just fine. However, when I run it, it kicks off the command window and crashes immediately due to a failed ASSERT. The ASSERT comes from appcore.cpp.[/li]
[/ul]
... Continued
Here is the link errors I get when I use my makefile
If I remove the 3 .objs (the console part) from the link step, then of course it's okay. But even if I ad just one back to the list of objs to link, it fails with this same error.
I know that the linker is giving me some clues about why the problem is happening "defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library", but I just can't quite piece it all together to make sense. Can someone please help me out?
many many thanks,
Barry
I am having a terrible time during the link step. Here is my scenario:
[ul]
[li]I have written a program that only uses classes from the standard C++ library. It is a console based app.[/li]
[li]Now I want to bolt on a GUI front end to this thing, so I used VS 7.0 to build a simple GUI. [/li]
[li]Both programs compile, link, and execute just fine. [/li]
[li]Now I bring in my classes from the console app into the VS project[/li]
[li]I created a makefile to build everything, but I get tons of linker errors. I have the output below[/li]
[li]Microsoft seems to be a little smarter in building this thing because it can build it just fine. However, when I run it, it kicks off the command window and crashes immediately due to a failed ASSERT. The ASSERT comes from appcore.cpp.[/li]
[/ul]
Code:
CWinApp::CWinApp(LPCTSTR lpszAppName)
{
if (lpszAppName != NULL)
m_pszAppName = _tcsdup(lpszAppName);
else
m_pszAppName = NULL;
// initialize CWinThread state
AFX_MODULE_STATE* pModuleState = _AFX_CMDTARGET_GETSTATE();
AFX_MODULE_THREAD_STATE* pThreadState = pModuleState->m_thread;
ASSERT(AfxGetThread() == NULL); //***** Fails here ***** AfxGetThread() is NOT NULL!!!!!!
... Continued
Here is the link errors I get when I use my makefile
Code:
link /OUT:"Release/PackageVerify.exe" /INCREMENTAL:NO /NOLOGO /DEBUG /PDB:"Release/PackageVerify.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /O
PT:ICF /MACHINE:IX86 release\\MainFrm.obj release\\Pack.obj release\\PackDoc.obj release\\PackView.obj
release\\main.obj release\\stdafx.obj release\\Pack.res release\\PackageVerify.obj release\\EJ
BPackageVerify.obj release\\ServletPackageVerify.obj
nafxcw.lib(thrdcore.obj) : error LNK2005: "public: virtual void __thiscall CWinThread::Delete(void)" (?Delete@CWinThread@@UAEXXZ) already de
fined in mfc70.lib(MFC70.DLL)
nafxcw.lib(thrdcore.obj) : error LNK2005: "public: virtual int __thiscall CWinThread::IsIdleMessage(struct tagMSG *)" (?IsIdleMessage@CWinTh
read@@UAEHPAUtagMSG@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(thrdcore.obj) : error LNK2005: "public: virtual int __thiscall CWinThread::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMe
ssage@CWinThread@@UAEHPAUtagMSG@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(thrdcore.obj) : error LNK2005: "public: virtual class CWnd * __thiscall CWinThread::GetMainWnd(void)" (?GetMainWnd@CWinThread@@UA
EPAVCWnd@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(thrdcore.obj) : error LNK2005: "public: virtual int __thiscall CWinThread::ProcessMessageFilter(int,struct tagMSG *)" (?ProcessMe
ssageFilter@CWinThread@@UAEHHPAUtagMSG@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(thrdcore.obj) : error LNK2005: "public: virtual int __thiscall CWinThread::PumpMessage(void)" (?PumpMessage@CWinThread@@UAEHXZ) a
lready defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(winstr.obj) : error LNK2005: "struct HINSTANCE__ * __stdcall AfxFindStringResourceHandle(unsigned int)" (?AfxFindStringResourceHa
ndle@@YGPAUHINSTANCE__@@I@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::PreSubclassWindow(void)" (?PreSubclassWindow@CWnd@@UAEXXZ) a
lready defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual void __thiscall CWnd::PostNcDestroy(void)" (?PostNcDestroy@CWnd@@MAEXXZ) alread
y defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::OnFinalRelease(void)" (?OnFinalRelease@CWnd@@UAEXXZ) already
defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual long __thiscall CWnd::DefWindowProcA(unsigned int,unsigned int,long)" (?DefWind
owProcA@CWnd@@MAEJIIJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual long (__stdcall** __thiscall CWnd::GetSuperWndProcAddr(void))(struct HWND__ *,u
nsigned int,unsigned int,long)" (?GetSuperWndProcAddr@CWnd@@MAEPAP6GJPAUHWND__@@IIJ@ZXZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::PreTranslateMessage(struct tagMSG *)" (?PreTranslateMessage@C
Wnd@@UAEHPAUtagMSG@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::OnToolHitTest(class CPoint,struct tagTOOLINFOA *)const " (?On
ToolHitTest@CWnd@@UBEHVCPoint@@PAUtagTOOLINFOA@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual struct AFX_MSGMAP const * __thiscall CWnd::GetMessageMap(void)const " (?GetMess
ageMap@CWnd@@MBEPBUAFX_MSGMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual long __thiscall CWnd::WindowProc(unsigned int,unsigned int,long)" (?WindowProc@
CWnd@@MAEJIIJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual class CScrollBar * __thiscall CWnd::GetScrollBarCtrl(int)const " (?GetScrollBarCtr
l@CWnd@@UBEPAVCScrollBar@@H@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::CalcWindowRect(struct tagRECT *,unsigned int)" (?CalcWindowR
ect@CWnd@@UAEXPAUtagRECT@@I@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual struct AFX_INTERFACEMAP const * __thiscall CWnd::GetInterfaceMap(void)const " (
?GetInterfaceMap@CWnd@@MBEPBUAFX_INTERFACEMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::EnsureStdObj(void)" (?EnsureStdObj@CWnd@@UAEJXZ) already def
ined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accParent(struct IDispatch * *)" (?get_accParent@CWnd@@U
AEJPAPAUIDispatch@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accChildCount(long *)" (?get_accChildCount@CWnd@@UAEJPAJ
@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accChild(struct tagVARIANT,struct IDispatch * *)" (?get_
accChild@CWnd@@UAEJUtagVARIANT@@PAPAUIDispatch@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accName(struct tagVARIANT,wchar_t * *)" (?get_accName@CW
nd@@UAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accValue(struct tagVARIANT,wchar_t * *)" (?get_accValue@
CWnd@@UAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accDescription(struct tagVARIANT,wchar_t * *)" (?get_acc
Description@CWnd@@UAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accRole(struct tagVARIANT,struct tagVARIANT *)" (?get_ac
cRole@CWnd@@UAEJUtagVARIANT@@PAU2@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accState(struct tagVARIANT,struct tagVARIANT *)" (?get_a
ccState@CWnd@@UAEJUtagVARIANT@@PAU2@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accHelp(struct tagVARIANT,wchar_t * *)" (?get_accHelp@CW
nd@@UAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accHelpTopic(wchar_t * *,struct tagVARIANT,long *)" (?ge
t_accHelpTopic@CWnd@@UAEJPAPA_WUtagVARIANT@@PAJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accKeyboardShortcut(struct tagVARIANT,wchar_t * *)" (?ge
t_accKeyboardShortcut@CWnd@@UAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accFocus(struct tagVARIANT *)" (?get_accFocus@CWnd@@UAEJ
PAUtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accSelection(struct tagVARIANT *)" (?get_accSelection@CW
nd@@UAEJPAUtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::get_accDefaultAction(struct tagVARIANT,wchar_t * *)" (?get_a
ccDefaultAction@CWnd@@UAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::accSelect(long,struct tagVARIANT)" (?accSelect@CWnd@@UAEJJUt
agVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::accLocation(long *,long *,long *,long *,struct tagVARIANT)"
(?accLocation@CWnd@@UAEJPAJ000UtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::accNavigate(long,struct tagVARIANT,struct tagVARIANT *)" (?a
ccNavigate@CWnd@@UAEJJUtagVARIANT@@PAU2@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::accHitTest(long,long,struct tagVARIANT *)" (?accHitTest@CWnd
@@UAEJJJPAUtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::accDoDefaultAction(struct tagVARIANT)" (?accDoDefaultAction@
CWnd@@UAEJUtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::put_accName(struct tagVARIANT,wchar_t *)" (?put_accName@CWnd
@@UAEJUtagVARIANT@@PA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::put_accValue(struct tagVARIANT,wchar_t *)" (?put_accValue@CW
nd@@UAEJUtagVARIANT@@PA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::SetProxy(struct IAccessibleProxy *)" (?SetProxy@CWnd@@UAEJPA
UIAccessibleProxy@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::CheckAutoCenter(void)" (?CheckAutoCenter@CWnd@@UAEHXZ) alread
y defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::ContinueModal(void)" (?ContinueModal@CWnd@@UAEHXZ) already de
fined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::SetOccDialogInfo(struct _AFX_OCC_DIALOG_INFO *)" (?SetOccD
ialogInfo@CWnd@@MAEHPAU_AFX_OCC_DIALOG_INFO@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::IsFrameWnd(void)const " (?IsFrameWnd@CWnd@@UBEHXZ) already de
fined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CFrameWnd::IsFrameWnd(void)const " (?IsFrameWnd@CFrameWnd@@UBEHXZ)
already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::CreateControlContainer(class COleControlContainer * *)" (?
CreateControlContainer@CWnd@@MAEHPAPAVCOleControlContainer@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::CreateControlSite(class COleControlContainer *,class COleC
ontrolSite * *,unsigned int,struct _GUID const &)" (?CreateControlSite@CWnd@@MAEHPAVCOleControlContainer@@PAPAVCOleControlSite@@IABU_GUID@@@
Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: __thiscall CWnd::CWnd(void)" (??0CWnd@@QAE@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::CreateEx(unsigned long,char const *,char const *,unsigned lon
g,struct tagRECT const &,class CWnd *,unsigned int,void *)" (?CreateEx@CWnd@@UAEHKPBD0KABUtagRECT@@PAV1@IPAX@Z) already defined in mfc70.lib
(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::Create(char const *,char const *,unsigned long,struct tagRECT
const &,class CWnd *,unsigned int,struct CCreateContext *)" (?Create@CWnd@@UAEHPBD0KABUtagRECT@@PAV1@IPAUCCreateContext@@@Z) already define
d in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::WinHelpInternal(unsigned long,unsigned int)" (?WinHelpIntern
al@CWnd@@UAEXKI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: int __thiscall CWnd::MessageBoxA(char const *,char const *,unsigned int)" (?MessageBoxA@CW
nd@@QAEHPBD0I@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: long __thiscall CWnd::GetAccessibilityLocation(struct tagVARIANT,long *,long *,long *,long
*)" (?GetAccessibilityLocation@CWnd@@QAEJUtagVARIANT@@PAJ111@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::EndModalLoop(int)" (?EndModalLoop@CWnd@@UAEXH@Z) already def
ined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::PreCreateWindow(struct tagCREATESTRUCTA &)" (?PreCreateWindow
@CWnd@@UAEHAAUtagCREATESTRUCTA@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::DestroyWindow(void)" (?DestroyWindow@CWnd@@UAEHXZ) already de
fined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: class CFrameWnd * __thiscall CWnd::GetParentFrame(void)const " (?GetParentFrame@CWnd@@QBEP
AVCFrameWnd@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: long __thiscall CWnd::GetAccessibleChildCount(void)" (?GetAccessibleChildCount@CWnd@@QAEJX
Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: long __thiscall CWnd::GetAccessibleChild(struct tagVARIANT,struct IDispatch * *)" (?GetAcc
essibleChild@CWnd@@QAEJUtagVARIANT@@PAPAUIDispatch@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: long __thiscall CWnd::GetAccessibilityHitTest(long,long,struct tagVARIANT *)" (?GetAccessi
bilityHitTest@CWnd@@QAEJJJPAUtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: void __thiscall CWnd::GetWindowTextA(class ATL::CStringT<char,class StrTraitMFC<char,class
ATL::ChTraitsCRT<char> > > &)const " (?GetWindowTextA@CWnd@@QBEXAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) already de
fined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::OnCommand(unsigned int,long)" (?OnCommand@CWnd@@MAEHIJ@Z)
already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::OnNotify(unsigned int,long,long *)" (?OnNotify@CWnd@@MAEHI
JPAJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: long __thiscall CWnd::GetAccessibleName(struct tagVARIANT,wchar_t * *)" (?GetAccessibleNam
e@CWnd@@QAEJUtagVARIANT@@PAPA_W@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual int __thiscall CWnd::CreateEx(unsigned long,char const *,char const *,unsigned lon
g,int,int,int,int,struct HWND__ *,struct HMENU__ *,void *)" (?CreateEx@CWnd@@UAEHKPBD0KHHHHPAUHWND__@@PAUHMENU__@@PAX@Z) already defined in
mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::OnWndMsg(unsigned int,unsigned int,long,long *)" (?OnWndMs
g@CWnd@@MAEHIIJPAJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual long __thiscall CWnd::CreateAccessibleProxy(unsigned int,long,long *)" (?CreateAcc
essibleProxy@CWnd@@UAEJIJPAJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::WinHelpA(unsigned long,unsigned int)" (?WinHelpA@CWnd@@UAEXK
I@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::HtmlHelpA(unsigned long,unsigned int)" (?HtmlHelpA@CWnd@@UAE
XKI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(wincore.obj) : error LNK2005: "protected: virtual int __thiscall CWnd::OnChildNotify(unsigned int,unsigned int,long,long *)" (?On
ChildNotify@CWnd@@MAEHIIJPAJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual int __thiscall CCmdTarget::OnCmdMsg(unsigned int,int,void *,struct AFX_CMDHANDLERI
NFO *)" (?OnCmdMsg@CCmdTarget@@UAEHIHPAXPAUAFX_CMDHANDLERINFO@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual int __thiscall CCmdTarget::IsInvokeAllowed(long)" (?IsInvokeAllowed@CCmdTarget@@UA
EHJ@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual int __thiscall CCmdTarget::GetDispatchIID(struct _GUID *)" (?GetDispatchIID@CCmdTa
rget@@UAEHPAU_GUID@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual unsigned int __thiscall CCmdTarget::GetTypeInfoCount(void)" (?GetTypeInfoCount@CCm
dTarget@@UAEIXZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual class CTypeLibCache * __thiscall CCmdTarget::GetTypeLibCache(void)" (?GetTypeLibCa
che@CCmdTarget@@UAEPAVCTypeLibCache@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual long __thiscall CCmdTarget::GetTypeLib(unsigned long,struct ITypeLib * *)" (?GetTy
peLib@CCmdTarget@@UAEJKPAPAUITypeLib@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual struct AFX_DISPMAP const * __thiscall CCmdTarget::GetDispatchMap(void)const " (
?GetDispatchMap@CCmdTarget@@MBEPBUAFX_DISPMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall CCmdTarget::GetEventSinkMap(void)con
st " (?GetEventSinkMap@CCmdTarget@@MBEPBUAFX_EVENTSINKMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual struct AFX_INTERFACEMAP const * __thiscall CCmdTarget::GetInterfaceMap(void)con
st " (?GetInterfaceMap@CCmdTarget@@MBEPBUAFX_INTERFACEMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual void __thiscall CCmdTarget::OnFinalRelease(void)" (?OnFinalRelease@CCmdTarget@@UAE
XXZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual int __thiscall CCmdTarget::OnCreateAggregates(void)" (?OnCreateAggregates@CCmdTarg
et@@UAEHXZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "public: virtual struct IUnknown * __thiscall CCmdTarget::GetInterfaceHook(void const *)" (?GetInte
rfaceHook@CCmdTarget@@UAEPAUIUnknown@@PBX@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual struct AFX_CONNECTIONMAP const * __thiscall CCmdTarget::GetConnectionMap(void)c
onst " (?GetConnectionMap@CCmdTarget@@MBEPBUAFX_CONNECTIONMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual struct IConnectionPoint * __thiscall CCmdTarget::GetConnectionHook(struct _GUID
const &)" (?GetConnectionHook@CCmdTarget@@MAEPAUIConnectionPoint@@ABU_GUID@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual int __thiscall CCmdTarget::GetExtraConnectionPoints(class CPtrArray *)" (?GetEx
traConnectionPoints@CCmdTarget@@MAEHPAVCPtrArray@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(cmdtarg.obj) : error LNK2005: "protected: virtual struct AFX_OLECMDMAP const * __thiscall CCmdTarget::GetCommandMap(void)const "
(?GetCommandMap@CCmdTarget@@MBEPBUAFX_OLECMDMAP@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(except.obj) : error LNK2005: "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ) already defined in
mfc70.lib(MFC70.DLL)
nafxcw.lib(winocc.obj) : error LNK2005: "public: virtual int __thiscall CWnd::OnAmbientProperty(class COleControlSite *,long,struct tagVARIA
NT *)" (?OnAmbientProperty@CWnd@@UAEHPAVCOleControlSite@@JPAUtagVARIANT@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(winocc.obj) : error LNK2005: "public: int __thiscall CWnd::ShowWindow(int)" (?ShowWindow@CWnd@@QAEHH@Z) already defined in mfc70.
lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::LoadSysPolicies(void)" (?LoadSysPolicies@CWinApp@@UAEHXZ)
already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::InitApplication(void)" (?InitApplication@CWinApp@@UAEHXZ)
already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual struct HINSTANCE__ * __thiscall CWinApp::LoadAppLangResourceDLL(void)" (?LoadAppLa
ngResourceDLL@CWinApp@@UAEPAUHINSTANCE__@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "protected: void __thiscall CWinApp::LoadStdProfileSettings(unsigned int)" (?LoadStdProfileSettings
@CWinApp@@IAEXI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: void __thiscall CWinApp::ParseCommandLine(class CCommandLineInfo &)" (?ParseCommandLine@CW
inApp@@QAEXAAVCCommandLineInfo@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual __thiscall CWinApp::~CWinApp(void)" (??1CWinApp@@UAE@XZ) already defined in mfc70.
lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::ExitInstance(void)" (?ExitInstance@CWinApp@@UAEHXZ) alread
y defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual long __thiscall CWinApp::ProcessWndProcException(class CException *,struct tagMSG
const *)" (?ProcessWndProcException@CWinApp@@UAEJPAVCException@@PBUtagMSG@@@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::OnIdle(long)" (?OnIdle@CWinApp@@UAEHJ@Z) already defined i
n mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CWinApp::GetRuntimeClass(void)const " (?GetRunti
meClass@CWinApp@@UBEPAUCRuntimeClass@@XZ) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::InitInstance(void)" (?InitInstance@CWinApp@@UAEHXZ) alread
y defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::Run(void)" (?Run@CWinApp@@UAEHXZ) already defined in mfc70
.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual void __thiscall CWinApp::WinHelpA(unsigned long,unsigned int)" (?WinHelpA@CWinApp@
@UAEXKI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual void __thiscall CWinApp::HtmlHelpA(unsigned long,unsigned int)" (?HtmlHelpA@CWinAp
p@@UAEXKI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual void __thiscall CWinApp::WinHelpInternal(unsigned long,unsigned int)" (?WinHelpInt
ernal@CWinApp@@UAEXKI@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: __thiscall CWinApp::CWinApp(char const *)" (??0CWinApp@@QAE@PBD@Z) already defined in mfc7
0.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: __thiscall CCommandLineInfo::CCommandLineInfo(void)" (??0CCommandLineInfo@@QAE@XZ) already
defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appcore.obj) : error LNK2005: "public: virtual __thiscall CCommandLineInfo::~CCommandLineInfo(void)" (??1CCommandLineInfo@@UAE@XZ
) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui1.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::DoMessageBox(char const *,unsigned int,unsigned int)" (?DoM
essageBox@CWinApp@@UAEHPBDII@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui1.obj) : error LNK2005: "int __stdcall AfxMessageBox(unsigned int,unsigned int,unsigned int)" (?AfxMessageBox@@YGHIII@Z) alr
eady defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui.obj) : error LNK2005: "public: virtual void __thiscall CWinApp::DoWaitCursor(int)" (?DoWaitCursor@CWinApp@@UAEXH@Z) already
defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::SaveAllModified(void)" (?SaveAllModified@CWinApp@@UAEHXZ) al
ready defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui.obj) : error LNK2005: "public: virtual void __thiscall CWinApp::AddToRecentFileList(char const *)" (?AddToRecentFileList@CW
inApp@@UAEXPBD@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui.obj) : error LNK2005: "public: virtual class CDocument * __thiscall CWinApp::OpenDocumentFile(char const *)" (?OpenDocument
File@CWinApp@@UAEPAVCDocument@@PBD@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui.obj) : error LNK2005: "public: virtual int __thiscall CWinApp::OnDDECommand(char *)" (?OnDDECommand@CWinApp@@UAEHPAD@Z) alr
eady defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(appui3.obj) : error LNK2005: "protected: void __thiscall CWinApp::SetRegistryKey(char const *)" (?SetRegistryKey@CWinApp@@IAEXPBD
@Z) already defined in mfc70.lib(MFC70.DLL)
nafxcw.lib(filest.obj) : error LNK2005: "public: static int __stdcall CFile::GetStatus(char const *,struct CFileStatus &)" (?GetStatus@CFile
@@SGHPBDAAUCFileStatus@@@Z) already defined in mfc70.lib(MFC70.DLL)
libc.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCR70.dll)
libc.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrt.lib(MSVCR70.dll)
libc.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrt.lib(MSVCR70.dll)
libc.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrt.lib(MSVCR70.dll)
libc.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj)
libc.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)
libc.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj)
libc.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj)
libc.lib(fflush.obj) : error LNK2005: _fflush already defined in msvcrt.lib(MSVCR70.dll)
libc.lib(crt0.obj) : error LNK2005: __amsg_exit already defined in msvcrt.lib(MSVCR70.dll)
libcp.lib(ios.obj) : error LNK2005: "public: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@QAEXXZ) already defined i
n msvcprt.lib(MSVCP70.dll)
libcp.lib(ios.obj) : error LNK2005: "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@std@@UAE@XZ) already defined in
msvcprt.lib(MSVCP70.dll)
libcp.lib(ios.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already define
d in msvcprt.lib(MSVCP70.dll)
libcp.lib(ios.obj) : error LNK2005: "protected: void __thiscall std::ios_base::_Init(void)" (?_Init@ios_base@std@@IAEXXZ) already defined in
msvcprt.lib(MSVCP70.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_
Getfacet@locale@std@@QBEPBVfacet@12@I@Z) already defined in msvcprt.lib(MSVCP70.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ)
already defined in msvcprt.lib(MSVCP70.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: __thiscall std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@std@@QAE@XZ) already defined in msv
cprt.lib(MSVCP70.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: __thiscall std::_Locinfo::_Locinfo(char const *)" (??0_Locinfo@std@@QAE@PBD@Z) already defi
ned in msvcprt.lib(MSVCP70.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: __thiscall std::locale::locale(void)" (??0locale@std@@QAE@XZ) already defined in msvcprt.li
b(MSVCP70.dll)
libcp.lib(locale.obj) : error LNK2005: "private: void __thiscall std::locale::_Locimp::_Addfac(class std::locale::facet *,unsigned int)" (?_
Addfac@_Locimp@locale@std@@AAEXPAVfacet@23@I@Z) already defined in msvcprt.lib(MSVCP70.dll)
libcp.lib(locale.obj) : error LNK2005: "private: __thiscall std::locale::_Locimp::_Locimp(class std::locale::_Locimp const &)" (??0_Locimp@l
ocale@std@@AAE@ABV012@@Z) already defined in msvcprt.lib(MSVCP70.dll)
libcp.lib(xwctomb.obj) : error LNK2005: __Getcvt already defined in msvcprt.lib(MSVCP70.dll)
LINK : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'nafxcw.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'libc.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
Release/PackageVerify.exe : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: 'link' : return code '0x491'
Stop.
If I remove the 3 .objs (the console part) from the link step, then of course it's okay. But even if I ad just one back to the list of objs to link, it fails with this same error.
I know that the linker is giving me some clues about why the problem is happening "defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library", but I just can't quite piece it all together to make sense. Can someone please help me out?
many many thanks,
Barry