GCC _CrtDumpMemoryLeaks include crtdbg.h
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