0

我正在尝试在我的 C++ 应用程序中使用 Visual Leak Detector(使用 Visual Studio 2013),在阅读了文档并修改Include DirectoriesLibrary Directories一个项目之后,我vld.h在我的一个文件中添加了标题cpp。正如文档中所写,我必须在源代码中的所有预编译头文件之后添加它。但是在我的源代码中添加标题后构建项目时,我收到以下错误:

[VLD COMPILE ERROR] #include "vld.h" should appear before #include <afxwin.h> in file stdafx.h

头文件位置消息

因此,当我将其添加到 stdafx.h 头文件中时,项目会构建,但我收到运行时错误消息: Unhandled exception at some_memory_location (vld_x64.dll) in product_debug_build.exe. Access violation reading location some_memory_location

访问冲突错误

当我将它放在我的任何cpp文件中的预编译头文件之前时,构建会跳过头文件的包含vld.h

跳过

但是当我构建整个解决方案时,我没有收到此消息,但是它不起作用(可能是因为我在预编译的标头之前添加了它?)。

我在这里做错了什么?

4

0 回答 0