问题描述
我正在使用 MinGW GCC + Eclipse ,并且我遇到了此错误:
I am using MinGW GCC + Eclipse on Windows, and I have run into this error:
什么是crtdbg.h
文件?如何获得并解决此问题?
What is the crtdbg.h
file? How can I get it and solve this problem?
推荐答案
<crtdbg.h>
是Microsoft Visual C ++特定的头.您可以使用类似于以下内容的存根来解决此问题:
<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
请注意,这将禁用正在编译的代码中的所有断言,并且如果正在编译的代码在crtdbg.h
中使用了更高级的功能(例如内存泄漏检测),仍将无济于事.如果使用了这些功能,则需要使用MSVC ++而不是MinGW编译代码.
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.
这篇关于如何获取crtdbg.h文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!