使用MTD时LNK2019错误,如果使用MDD编译通过。为什么? [英] LNK2019 error when use MTD, If use MDD the compile pass. Why?

查看:79
本文介绍了使用MTD时LNK2019错误,如果使用MDD编译通过。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C ++



使用MTD编译时的编译按摩如下所示。



C++

The compile massages like following when use MTD compile.

libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)



很多答案都设置为MTD和MDD都可以。但实际上MTD无法编译pass.Just MDD就行了。





提前致谢。


Many answer is set MTD and MDD will be OK. But in fact MTD can not compile pass.Just MDD will OK.


Thanks in advance.

推荐答案

它是链接器而不是正在大喊大叫的编译器。链接器问题更难以理解和解决:-O



您可以在目标中链接libcpmtd.lib。这个lib用于调试。您的DebugHeapTag会触发错误。扔出去!你弄乱了一些项目设置,可能是MFC或stdafx.h。



阅读本文章更好地理解选项。
it is the "linker" and not the "compiler" which is yelling. Linker problems are even harder to understand and to solve :-O

You link the libcpmtd.lib in your target. This lib is for debug. Your DebugHeapTag triggers the error. Throw it out! You messed up some project settings, maybe the MFC or the stdafx.h.

Read this article to understand the options better.


这篇关于使用MTD时LNK2019错误,如果使用MDD编译通过。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆