Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/125.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 发布版本生成时发生GLUI运行时错误_C++_Visual Studio 2010_Visual C++_Visual C++ 2010_Glui - Fatal编程技术网

C++ 发布版本生成时发生GLUI运行时错误

C++ 发布版本生成时发生GLUI运行时错误,c++,visual-studio-2010,visual-c++,visual-c++-2010,glui,C++,Visual Studio 2010,Visual C++,Visual C++ 2010,Glui,我正在使用GLUI开发我的第一个应用程序,我遇到了一些问题。我在Windows7机器上使用VisualStudio2010,并使用glui-2.35。我的应用程序在调试模式下构建时运行良好,但在发布模式下构建时由于运行时错误而崩溃。调试器中的错误来自glui.cpp中此函数的最后一条语句: void GLUI_Master_Object::set_glutReshapeFunc(void (*f)(int width, int height)) { glutReshapeFunc( glui

我正在使用GLUI开发我的第一个应用程序,我遇到了一些问题。我在Windows7机器上使用VisualStudio2010,并使用glui-2.35。我的应用程序在调试模式下构建时运行良好,但在发布模式下构建时由于运行时错误而崩溃。调试器中的错误来自glui.cpp中此函数的最后一条语句:

void GLUI_Master_Object::set_glutReshapeFunc(void (*f)(int width, int height))
{
  glutReshapeFunc( glui_reshape_func );
  add_cb_to_glut_window( glutGetWindow(), GLUI_GLUT_RESHAPE, (void*) f);
}

我不知道为什么发布版本会崩溃;任何建议都将不胜感激。

我不是MSVC++调试和发布模式方面的专家,但我一直在寻找一些信息,在中,一些用户谈到了这一点

其中一个@McDeeis在本页中说:

...
In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account. 
While in release build the symbolic debug info is not emitted and the code execution is optimized.
Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.

One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are usually referred to as Release...
无论如何,请检查GLUI或您的项目所依赖的库是否也已使用发布模式编译。这可能会引起问题