GLUI runtime error with release build

238 views Asked by At

I'm developing my first application using GLUI and I'm having some problems. I'm using Visual Studio 2010 on a Windows 7 machine and using glui-2.35. My application runs fine when built in debug mode but crashes with a runtime error when built in release mode. From the debugger the error is from the last statement in this function from 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);
}

I'm not sure why the release build crashes; any suggestions would be greatly appreciated.

1

There are 1 answers

0
fenix688 On

I'm not an expert in MSVC++ debug and release mode but I've been looking for some information, and in this website, some users talk about it.

One of them (@mcdeeiis), in this page, says:

...
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...

Anyway, check sure the libraries that GLUI or your project depends on, have been compiled with release mode too. It might cause problems.