描述:
我想在所写的ATL DLL COM组件中使用C的动态分配函数realloc()以及free(),并想使用文件处理函数fopen()以及fclose()等。此时,编译时出现了如下错误提示。初步看,自己的理解是两个静态库的定义出现了冲突。请各位请点迷津。谢谢了。
如下是链接时的出错信息:
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fopen already defined in LIBCMTD.lib(fopen.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fread already defined in LIBCMTD.lib(fread.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fwrite already defined in LIBCMTD.lib(fwrite.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fseek already defined in LIBCMTD.lib(fseek.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _ftell already defined in LIBCMTD.lib(ftell.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fputc already defined in LIBCMTD.lib(fputc.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _getc already defined in LIBCMTD.lib(fgetc.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBCMTD.lib(isctype.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __open already defined in LIBCMTD.lib(open.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __setmode already defined in LIBCMTD.lib(setmode.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __read already defined in LIBCMTD.lib(read.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __lseek already defined in LIBCMTD.lib(lseek.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __close already defined in LIBCMTD.lib(close.obj)
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _free already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _malloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _realloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fopen already defined in LIBCMTD.lib(fopen.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fclose already defined in LIBCMTD.lib(fclose.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fread already defined in LIBCMTD.lib(fread.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fwrite already defined in LIBCMTD.lib(fwrite.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fseek already defined in LIBCMTD.lib(fseek.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _ftell already defined in LIBCMTD.lib(ftell.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fflush already defined in LIBCMTD.lib(fflush.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fputc already defined in LIBCMTD.lib(fputc.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _getc already defined in LIBCMTD.lib(fgetc.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _strncpy already defined in LIBCMTD.lib(strncpy.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _calloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _strncmp already defined in LIBCMTD.lib(strncmp.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _sprintf already defined in LIBCMTD.lib(sprintf.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: __isctype already defined in LIBCMTD.lib(isctype.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _abort already defined in LIBCMTD.lib(abort.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _fprintf already defined in LIBCMTD.lib(fprintf.obj); second definition ignored
MSVCRT.lib(MSVCRT.dll) :