wxWidgets链接错"malloc already defined"

(发于Sunday, March 23, 2008)

使用Visual C++ 2005编译wxWidgets,当编译成静态链接库的时候,可能碰到下面的链接错:

 

Linking...
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRTD.lib(MSVCR80D.dll)
(...)
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

 

解决方法:到Configuration Properties -> C++ -> Code Generation, 把"Runtime Library" 从"Multi-threaded Debug DLL/MDd" 改为 "Multi-threaded Debug/MTd"

你可能感兴趣的:(c,properties,function,library,generation)