visual studio 2008中 error LNK2005的解决方法

原创 2015年07月06日 18:22:11
1>------ Rebuild All started: Project: LookUpTableTest, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'LookUpTableTest', configuration 'Debug|Win32'
1>Compiling...
1>LookUpTableTest.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in libcpmtd.lib(string.obj)
1>msvcprtd.lib(MSVCP90D.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) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::compare(char const *)const " (?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHPBD@Z) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (?_Orphan_all@_Container_base_secure@std@@QBEXXZ) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) already defined in libcpmtd.lib(stdthrow.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpmtd.lib(string.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in libcpmtd.lib(string.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (??1_Container_base_secure@std@@QAE@XZ) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (??0_Container_base_secure@std@@QAE@XZ) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "bool __cdecl std::operator==<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z) already defined in LookUpTableTest.obj
1>msvcprtd.lib(MSVCP90D.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> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in LookUpTableTest.obj
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>.\Debug/LookUpTableTest.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://e:\论文相关\Marching cubes\MarchingCubes\Debug\BuildLog.htm"
1>LookUpTableTest - 29 error(s), 1 warning(s)

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



试了很多很多方法,最终在VS2008的help中查到一种方法,竟然好了,就是在项目的properties-->configuration properties-->Command Lines中输入/FORCE:MULTIPLE   确定就好了

Visual Studio Tips: error LNK2005: ... already defined in LIBCMTD.lib(new.obj)

遇到的问题 一个很老的C++工程,之前编译一切正常,就在我引入了几个新的 .h 和 .cpp 文件之后,编译死活通不过了,报以下错误: Error 2 error LNK2005: "void...
  • XinYaping
  • XinYaping
  • 2015年05月13日 03:07
  • 1762

安装Visual Studio 2008系统要求

安装Visual Studio 2008系统要求 1.1 支持的体系结构: x86 x64 (WOW) 不支持 IA64 1.2 支持的操作系统 Microsoft Windows XP Profes...
  • hsg77
  • hsg77
  • 2008年04月23日 14:28
  • 4110

error LNK2005: _DllMain@12 already defined in dllmain.obj

VC2008: 1>uafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in dllmain.obj 解决...
  • lys07962000
  • lys07962000
  • 2014年10月20日 11:39
  • 1019

Visual Studio 2008 简体中文专业版下载(附序列号)破解 几种办法

今天发现微软已经提供了专业版的试用版, 换个号就可以变正式版了。需要的朋友就下载了。 http://download.microsoft.com/do ... rialCHSX1435983....
  • lxdzjlzp
  • lxdzjlzp
  • 2012年12月12日 12:39
  • 4107

Visual Studio 2008系列教程(一):VS 2008安装详解!

前天得知Visual Studio 2008的正式版发布了!所以到www.Microsoft.com去看了一下,确定VS2008是真的发布了。不知道他会给我们带来什么惊喜呢?我们大家一起来体验一下吧!...
  • xuejinyoulan
  • xuejinyoulan
  • 2007年11月21日 09:59
  • 16880

【C++】利用Visual Studio 2008编写C++,Visual Studio 2008的基本使用

现在很多高校还是利用Visual C++ 6.0这一经典版本在教C++,很多人对自己第一个程序的回忆是利用Visual C++ 6.0用C语言写的Helloworld,之后再学习C++的类,不过还是在...
  • yongh701
  • yongh701
  • 2015年07月20日 15:36
  • 3888

如何使用Visual Studio 2008打包发布开发好的应用程序

最近测试应用程序在不同操作系统的运行情况时(主要为Windows操作系统,例如Windows XP 32Bit&64Bit/Windows 7 32Bit&64Bit等),当目标操作系统无.net ...
  • WolfMvP
  • WolfMvP
  • 2015年03月31日 10:44
  • 1650

Visual Studio 2008 创建dll 动态链接库

1 在Visual C++ 里面选择Win32,新建一个Win32 Project工程,名称为mydll2 在Application Settings窗口,Application type中选择 DL...
  • zhenxiaohui
  • zhenxiaohui
  • 2009年08月19日 17:14
  • 14015

Windows7:Visual Studio 2008试用版的评估期已经结束 的解决方法

WinXP下一直安装的同一个VS2008ProCN 90天试用版,安装完后然后在添加删除程序中进行升级,输入Key后就可以正常使用。后来换了Win7后却找不到输入Key的输入框o(╯□╰)o ,问了度...
  • wwwdbs
  • wwwdbs
  • 2015年04月07日 13:15
  • 2054

Visual Studio 2008 试用版过期版的升级方法

Visual Studio 2008试用版过期激活方法VS2008中英文正式版序列号 1.Visual Studio 2008 Professional Edition: XMQ2Y-4T3V6-XJ...
  • Z378899073
  • Z378899073
  • 2011年02月06日 09:24
  • 2498
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:visual studio 2008中 error LNK2005的解决方法
举报原因:
原因补充:

(最多只允许输入30个字)