【问题标题】:GLUI runtime error with release build发布版本的 GLUI 运行时错误
【发布时间】:2014-08-06 01:55:14
【问题描述】:

我正在使用 GLUI 开发我的第一个应用程序,但遇到了一些问题。我在 Windows 7 机器上使用 Visual Studio 2010 并使用 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);
}

我不确定发布版本崩溃的原因;任何建议将不胜感激。

【问题讨论】:

    标签: c++ visual-studio-2010 visual-c++ visual-c++-2010 glui


    【解决方案1】:

    我不是 MSVC++ 调试和发布模式方面的专家,但我一直在寻找一些资料,在this website,一些用户谈论它。

    其中一个 (@mcdeeiis) 在此页面中说:

    ...
    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 或您的项目所依赖的库是否也已使用发布模式编译。这可能会导致问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-10
      相关资源
      最近更新 更多