Search code examples
c++visual-c++openglglew

Including glew using only source files?


For reasons outside of my comprehension, glew will simply not work when statically linked. Is there a way to simply just include the glew.h, glxew.h, wglew.h and glew.c source files into my project and use

#include "glew.h"

instead of

#include <glew.h>

whenever i try i get an explosion of warnings: like

warning C4273: '__WGLEW_NV_render_depth_texture' : inconsistent dll linkage

Solution

  • Have you seen the GLEW installation/building page?

    http://glew.sourceforge.net/install.html

    If you are building it statically (which it sounds like you are), you need to define the GLEW_STATIC macro before include glew.h (or else it won't compile). The easiest way to do this is to add an option to your project; or if you are stubborn you could just do this:

     #define GLEW_STATIC
     #include "glew.h"