在编译中遇到 defaultlib "MSVCRT" conflicts with use of other libs 怎么解决??急!!!
我的程序使用到了 postgresql 数据库的C接口函数,如果使用动态库libpq.dll程序编译没有任何问题,但是如果使用静态的libpq.lib,在编译中会出现以下错误
程序中MFC使用的也是静态连接。
Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in libcmtd.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in libcmtd.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __snprintf already defined in libcmtd.lib(snprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in libcmtd.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _tolower already defined in libcmtd.lib(tolower.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in libcmtd.lib(isctype.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strspn already defined in libcmtd.lib(strspn.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncmp already defined in libcmtd.lib(strncmp.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __errno already defined in libcmtd.lib(dosmap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strtoul already defined in libcmtd.lib(strtol.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in libcmtd.lib(getenv.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _atoi already defined in libcmtd.lib(atox.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in libcmtd.lib(memmove.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in libcmtd.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fgets already defined in libcmtd.lib(fgets.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fopen already defined in libcmtd.lib(fopen.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in libcmtd.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __vsnprintf already defined in libcmtd.lib(vsnprint.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in libcmtd.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __strdup already defined in libcmtd.lib(strdup.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __stricmp already defined in libcmtd.lib(stricmp.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/dataman.exe : fatal error LNK1169: one or more multiply defined symbols found
用于是刚接触VC,请各位能帮帮小弟,谢了!!! 急!!!!