我的VC工程中引入一个第三方功能的静态链接库,编译过,链接时报错,下面是输出窗口的错误信息:
--------------------Configuration: MPTP - Win32 Release--------------------
Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strerror already defined in LIBCMT.lib(strerror.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCMT.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in LIBCMT.lib(strchr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _abort already defined in LIBCMT.lib(abort.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _time already defined in LIBCMT.lib(time.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _localtime already defined in LIBCMT.lib(localtim.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBCMT.lib(isctype.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __errno already defined in LIBCMT.lib(dosmap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fopen already defined in LIBCMT.lib(fopen.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fwrite already defined in LIBCMT.lib(fwrite.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCMT.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __setmode already defined in LIBCMT.lib(setmode.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fgets already defined in LIBCMT.lib(fgets.obj)
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _strerror already defined in LIBCMT.lib(strerror.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _strncpy already defined in LIBCMT.lib(strncpy.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _strchr already defined in LIBCMT.lib(strchr.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _sprintf already defined in LIBCMT.lib(sprintf.obj); second definition ignored
...... (略)
Creating library Release/MPTP.lib and object Release/MPTP.exp
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
Release/MPTP.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.MPTP.dll - 17 error(s), 17 warning(s)我加上了/nodefaultlib:libcmt.lib
结果又有其它程序出现错误:
--------------------Configuration: MPTP - Win32 Release--------------------
Linking...
   Creating library Release/MPTP.lib and object Release/MPTP.exp
octstr.obj : error LNK2001: unresolved external symbol __pctype
octstr.obj : error LNK2001: unresolved external symbol ___mb_cur_max
Release/MPTP.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.MPTP.dll - 3 error(s), 0 warning(s)我对编译链接的底层原理不懂,不如遇到这样的问题应如何解决?
恳请帮助!!!谢谢!!!