将“MFC的使用:”改成“在静态库中使用MFC”后,程序无法运行了,出了一堆错,如何解决?
部分错误如下:1>nafxcw.lib(docmgr.obj):errorLNK2005:"void__stdcall_AfxAppendFilterSuffix(cla...
部分错误如下:
1>nafxcw.lib(docmgr.obj) : error LNK2005: "void __stdcall _AfxAppendFilterSuffix(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > &,struct tagOFNA &,class CDocTemplate *,class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > *)" (?_AfxAppendFilterSuffix@@YGXAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@AAUtagOFNA@@PAVCDocTemplate@@PAV12@@Z) 已经在 DocManagerEx.obj 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) 已经在 SETerrainMaterialHandler.obj 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) 已经在 HELLO.obj 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::reserve(unsigned int)" (?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z) 已经在 libcpmt.lib(wlocale.obj) 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) 已经在 SESkeletonEx.obj 中定义
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _fread 已经在 libcmt.lib(fread.obj) 中定义
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已经在 libcmt.lib(typinfo.obj) 中定义
1>LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>bin\Release\HELLO.exe : fatal error LNK1169: 找到一个或多个多重定义的符号 展开
1>nafxcw.lib(docmgr.obj) : error LNK2005: "void __stdcall _AfxAppendFilterSuffix(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > &,struct tagOFNA &,class CDocTemplate *,class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > *)" (?_AfxAppendFilterSuffix@@YGXAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@AAUtagOFNA@@PAVCDocTemplate@@PAV12@@Z) 已经在 DocManagerEx.obj 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) 已经在 SETerrainMaterialHandler.obj 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) 已经在 HELLO.obj 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::reserve(unsigned int)" (?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z) 已经在 libcpmt.lib(wlocale.obj) 中定义
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) 已经在 SESkeletonEx.obj 中定义
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _fread 已经在 libcmt.lib(fread.obj) 中定义
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已经在 libcmt.lib(typinfo.obj) 中定义
1>LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>bin\Release\HELLO.exe : fatal error LNK1169: 找到一个或多个多重定义的符号 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询