_CRT_DEBUGGER_HOOK抛出异常 [英] _CRT_DEBUGGER_HOOK throws exception
问题描述
我有一个问题将我的程序从VS2005转换到VS2008。当我运行
程序在VS2008,应用程序启动正常,但当开始播放
周围与应用程序它崩溃给我这个错误:
I'm having a problem converting my program from VS2005 to VS2008. When I run the program in VS2008, the application starts up fine but when start playing around with the application it crashes giving me this error:
Microsoft Visual Studio C运行时库检测到致命错误
"Microsoft Visual Studio C Runtime Library has detected a fatal error"
然后调试器指向此函数:
And then the debugger points me to this function:
__declspec(noinline)
void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
{
/* assign 0 to _debugger_hook_dummy so that the function is not folded
in retail */
(_Reserved);
_debugger_hook_dummy = 0;
}
编译应用程序ase版本完美工作...
compiling the application ase release works prefectly...
顺便说一句,这是一个本地代码调用托管.NET代码的托管c ++代码。
By the way, this is a native code calling a managed c++ code that wrapps .NET code.
如何调试这种情况?
Ofer
推荐答案
确保所有的依赖关系与VS2008调试。
Make sure all of your dependencies are also compiled with VS2008 debug.
我在VS2008-debug中编译程序时遇到了同样的问题,以及一些在VS2003中编译的依赖DLL,在VS2008-debug和一些依赖性编译为release。
I experienced this same issue when compiling a program in VS2008-debug, and some of the dependent DLLs where compiled in VS2003, and also when compiling a program in VS2008-debug and some of the dependencies where compiled as release.
这篇关于_CRT_DEBUGGER_HOOK抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!