I am trying to use Visual Leak Detector in my C++ application (using visual studio 2013), and after reading the documentation and modifying Include Directories
and Library Directories
of a project, I am adding vld.h
header in one of my cpp
files. As written in the documentation I have to add it after all the precompiled headers in the source. But while building the project after adding the header in my source code I am getting following error:
[VLD COMPILE ERROR] #include "vld.h" should appear before #include <afxwin.h> in file stdafx.h
so when I add it in the stdafx.h header file, the project builds but I get a runtime error saying:
Unhandled exception at some_memory_location (vld_x64.dll) in product_debug_build.exe. Access violation reading location some_memory_location
And when I put it before precompiled headers in any of my cpp
files, then the build skips the inclusion of the header file vld.h
.
But I don't get this message when I build the whole solution, but then it doesn't work (probably because I am adding it before precompiled headers ?).
What am I doing wrong here?