我正在用一个不太有用的诊断信息来追踪一个内存错误:
HEAP[myprogram_run.exe]: HEAP: Free Heap block e0969b0 modified at e096a70 after it was freed
Windows has triggered a breakpoint in myprogram_run.exe.
This may be due to a corruption of the heap, and indicates a bug in myprogram_run.exe or any of
the DLLs it has loaded.
The output window may have more diagnostic information
The program '[9340] myprogram_run.exe: Native' has exited with code -1 (0xffffffff).
环顾四周后,我发现这些 MSDN 链接: http: //msdn.microsoft.com/en-US/library/e5ewb1h3%28v=vs.80%29我将项目属性预处理器定义(在 C/C++ 下)设置为包括 _DEBUG 并且在我的主要功能中,我也按照推荐的顺序添加了以下内容(在上面的链接中):
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
...
int main(..,..) {
...
_CrtDumpMemoryLeaks();
return retval;
}
但我仍然没有在 Visual Studio 解决方案的输出窗口中看到广告的诊断输出(包括行号等)?感谢有关如何正确诊断此问题的任何见解。谢谢!
我可以在项目属性下设置