• Scientific Computing | SciVision
  • About
  • Blog
  • Tags
  • Categories

GCC _CrtDumpMemoryLeaks include crtdbg.h

11 May, 2022

On Windows, C++ programs that use _CrtDumpMemoryLeaks should have the appropriate include statement to work on Windows with non-Visual Studio compilers such as GCC. Example:

#ifdef _WIN32
#include <crtdbg.h>
#endif


// near the end of the function to be checked
#ifdef _WIN32
  _CrtDumpMemoryLeaks();
#endif
  • windows
  • visual-studio
  • gcc
GitHub - scivision | geospace-code | space-physics | fortran-gaming