为什么我在static编译时出错,而share编译时不出错。只是因为使用了几个lib文件,就出现这样的问题啦?请大家帮帮忙吧。
出错码:
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fopen already defined in libcmtd.lib(fopen.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in libcmtd.lib(fclose.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fread already defined in libcmtd.lib(fread.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fwrite already defined in libcmtd.lib(fwrite.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fseek already defined in libcmtd.lib(fseek.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _ftell already defined in libcmtd.lib(ftell.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fflush already defined in libcmtd.lib(fflush.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _floor already defined in libcmtd.lib(floor.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _realloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _ceil already defined in libcmtd.lib(ceil.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in libcmtd.lib(strncpy.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncmp already defined in libcmtd.lib(strncmp.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _exit already defined in libcmtd.lib(crt0dat.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fprintf already defined in libcmtd.lib(fprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _getenv already defined in libcmtd.lib(getenv.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _abort already defined in libcmtd.lib(abort.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _gmtime already defined in libcmtd.lib(gmtime.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in libcmtd.lib(memmove.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strstr already defined in libcmtd.lib(strstr.obj)
出错码:
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fopen already defined in libcmtd.lib(fopen.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in libcmtd.lib(fclose.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fread already defined in libcmtd.lib(fread.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fwrite already defined in libcmtd.lib(fwrite.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fseek already defined in libcmtd.lib(fseek.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _ftell already defined in libcmtd.lib(ftell.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fflush already defined in libcmtd.lib(fflush.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _floor already defined in libcmtd.lib(floor.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _realloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _ceil already defined in libcmtd.lib(ceil.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in libcmtd.lib(strncpy.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncmp already defined in libcmtd.lib(strncmp.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _exit already defined in libcmtd.lib(crt0dat.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fprintf already defined in libcmtd.lib(fprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _getenv already defined in libcmtd.lib(getenv.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _abort already defined in libcmtd.lib(abort.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _gmtime already defined in libcmtd.lib(gmtime.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in libcmtd.lib(memmove.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strstr already defined in libcmtd.lib(strstr.obj)
菜单"Project"-"Setting"-link-input-ignor librarirs
里面输入
MSVCRTD.lib
http://www.xiph.org/archives/vorbis-dev/200109/0200.html
里面输入
libcmtd.lib
结果如下:
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
nafxcwd.lib(olelink.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(dcmeta.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(oledlgs1.obj) : error LNK2001: unresolved external symbol __mbctype
Debug/graph.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Creating browse info file...graph.exe - 9 error(s), 0 warning(s)