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   确定就好了

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

error:LNK2005 已经在*.obj中定义

实习项目中涉及到静态库的编写,在用实例调试静态库的时候,遇到LNK2005重复定义错误:已经在“*.obj”中定义。 上网搜了一下,总结有如下几种情况: 1、重复定义全局变量 全局变量是针对整个...

error LNK2005: 已经在*.obj中定义

为什么会出现这个错误??“error LNK2005: 已经在*.obj中定义”    编程中经常能遇到LNK2005错误——重复定义错误,其实LNK2005错误并不是一个很难解决的错误,弄清楚它形...

VC++编译代码出现LNK2005错误的一种情况的解决

在一个VC控制台应用程序中,加入对ADO的引用,编译后,出现如下错误提示, 1>MSVCRTD.lib(MSVCR120D.dll) : error LNK2005: __beginthre...

c++ error LNK2005......错误解决方法

错误如图 解决方案: 一 今天被error LNK2005这个问题折腾了好久好久,从网上找了一些文章看了看,大多数都说是 头文件包含比较混乱,同一个文件被多个文件包含了;还有的说是某两个...

关于error LNK2005的解决办法

作者:朱金灿来源:http://blog.csdn.net/clever101/      一位网友看了我的《VC和LUA混合开发之VC程序调用Lua脚本函数》,说参考了我做的,封装成自己的...

error LNK2005

uafxcwd.lib(afxglobals.obj) error LNK2005: "public: virtual __thiscall CMemDC::~CMemDC(void)" ...

json静态链接错误:msvcprtd.lib(MSVCP100D.dll) : error LNK2005:解决方案

本文提供了一种解决json链接错误的方案。
  • shufac
  • shufac
  • 2016-09-30 22:14
  • 2754

关于ERROR LNK 2005错误

关于ERROR LNK 2005错误相信很多人对这个错误是一点也不陌生,甚至有些害怕,我也一样。其实自己遇到过这样的问题,也每次都解决了这样的问题,但关键是自己没总结,所以总是再遇到再改,很烦人,查资...
  • li_007
  • li_007
  • 2008-08-20 14:53
  • 15500

在 VS 中编译项目时出现 error LNK2005 链接错误的解决办法

在 VS 中编译项目时出现 error LNK2005 链接错误的解决办法   【问题】 mfcs90d.lib(xxx.obj)  :  error LNK2005: DllMain@12 alr...
  • iw1210
  • iw1210
  • 2015-02-13 16:54
  • 3778

vs2013 error LNK2005 已经在***.obj中定义

(1)错误案例:在写日志程序中出现,工程是MFC程序(注:win32控制台应用程序,不会出现这种错误,当然是不支持MFC库的那种) (2)错误原因:如下能看出一点眉目,重定义了.在使用***.o...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

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