MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)

发布于 2020-05-05  50 次阅读


问题描述:

在用VC6.0 Debug编译程序的时候出现以下错误

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) : warning LNK4006: _malloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored

MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _free already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored

解决方法:

在设置(Setting)中选择标签Link,然后在下拉框中选择Input,然后在Ignore libraies中填写:MSVCRT.lib,如下图


一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。