当前位置: 代码迷 >> VC >> 疯了! error LNK2005:该怎么处理
  详细解决方案

疯了! error LNK2005:该怎么处理

热度:6889   发布时间:2013-02-25 00:00:00.0
疯了!! error LNK2005:
求救:链接错误信息如下。 在release版本正常,在Debug模式下不行,如下:

8>abcdefg.obj : error LNK2005: _DllMain@12 already defined in CSCommonInterface.obj
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _wcslen already defined in LIBCMTD.lib(wcslen.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
8>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)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj)
8>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)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __wassert already defined in LIBCMTD.lib(wassert.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
8>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)
8>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)
8>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
8> Creating library ../../lib/AdNetwork.lib and object ../../lib/AdNetwork.exp
8>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
8>abcdefg.obj : error LNK2019: unresolved external symbol "struct _AdapterEnv_t * __cdecl CreateNTAdapterEnv(void)" (?CreateNTAdapterEnv@@YAPAU_AdapterEnv_t@@XZ) referenced in function _CSCI_LoadLibrary
8>abcdefg.obj : error LNK2019: unresolved external symbol "struct _AdapterEnv_t * __cdecl CreateXYAdapterEnv(void)" (?CreateXYAdapterEnv@@YAPAU_AdapterEnv_t@@XZ) referenced in function _CSCI_LoadLibrary
8>abcdefg.obj : error LNK2019: unresolved external symbol "void __cdecl DestroyNTAdapterEnv(struct _AdapterEnv_t *)" (?DestroyNTAdapterEnv@@YAXPAU_AdapterEnv_t@@@Z) referenced in function _CSCI_FreeLibrary
8>abcdefg.obj : error LNK2019: unresolved external symbol "void __cdecl DestroyXYAdapterEnv(struct _AdapterEnv_t *)" (?DestroyXYAdapterEnv@@YAXPAU_AdapterEnv_t@@@Z) referenced in function _CSCI_FreeLibrary


------解决方案--------------------------------------------------------
如果Release下没有问题 那么楼主去检查一下 你是不是将那个宏定义定义错了地方
  相关解决方案