Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get crtdbg.h file?

Tags:

c++

eclipse

mingw

I am using MinGW GCC + Eclipse on Windows, and I have run into this error:

C:\Program Files\ITG Derivatives LLC\api_clear-2.0.2.48\include/windows/csassert.h:12:20: fatal error crtdbg.h No such file or directory

What is the crtdbg.h file? How can I get it and solve this problem?

like image 545
2607 Avatar asked Oct 02 '12 05:10

2607


2 Answers

<crtdbg.h> is a Microsoft Visual C++ specific header. You may be able to work around this problem using a stub similar to the following:

#ifdef _MSC_VER
#include <crtdbg.h>
#else
#define _ASSERT(expr) ((void)0)

#define _ASSERTE(expr) ((void)0)
#endif

Note that this will disable any asserts in the code you are compiling against, and still won't help you if the code you're compiling uses more advanced features inside crtdbg.h, such as memory leak detection. If these features are in use, you will need to compile the code with MSVC++ rather than MinGW.

like image 152
Bhavik Ambani Avatar answered Sep 21 '22 05:09

Bhavik Ambani


I ran into this exact same issue, but with Visual Studio Community Edition 2019.

The solution was to download the Windows 10 SDK using the Visual Studio installer. Once I did that the next compile worked fine.

The header file "crtdbg.h" is part of the Windows 10 SDK kit. I believe you will find crtdbg.h located here C:\Program Files... or C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\crtdbg.h depending on your setup and version.

like image 40
James Drinkard Avatar answered Sep 19 '22 05:09

James Drinkard