libglui / glui

GLUI is a GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications. It is window-system independent, using GLUT or FreeGLUT.
Other
196 stars 81 forks source link

Fix in glui.h for inclusion of correct lib in VS projects #34

Open josch opened 9 years ago

josch commented 9 years ago

https://sourceforge.net/p/glui/patches/10/

Glui.h contains a pragma to include glui32.lib (release version) automatically. However, it does so regardless of the project being compiled being in debug or release configuration. This leads to crashes in settings where the Release lib is used in a Debug configuration. This patch adds an #ifdef block to make sure the correct lib is included (glui32.lib or glui32d.lib)

98c98,102
< #      pragma comment(lib, "glui32.lib")  

---
> #      if defined _DEBUG  // include debug lib if in debug mode
> #        pragma comment(lib, "glui32d.lib")  
> #      else
> #        pragma comment(lib, "glui32.lib")  
> #      endif