观察这个接近的场景,即使它看起来和我之前的问题一样。我仍然没有得到答案。所以请不要报告为重复。
我有一个项目,它有 10 个依赖项。首先,我在主项目的 C/C++ 代码生成部分中使用 /MTD 选项进行编译,并且它的所有依赖项都已成功构建。
接下来,我将选项从 /MTD 更改为 /MDd,并且所有相关项目都已成功构建。但是对于主项目报如下错误:
LIBCMTD.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib(lseeki64.obj) : error LNK2005: __lseeki64 already defined in MSVCRTD.lib(MSVCR80D.dll)
sqlite3x.lib(sqlite3x_command.obj) : error LNK2005: "protected: wchar_t * __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::_Myptr(void)" (?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEPA_WXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __mkdir already defined in LIBCMTD.lib(mkdir.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __strdup already defined in
LIBCMTD.lib(strdup.obj)
Creating library Debug/Application.lib and object Debug/Application.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
我怎样才能解决这个问题?