I am confused. I have seen examples programs using glCreateShader() and some using glewCreateShader().
With Windows Visual Studio 2010 I get the following error:
error LNK2019: unresolved external symbol _glCreateShader@
I am linking the following libraries (all 32-bit):
sdl2.lib
sdl2main.lib
opengl32.lib
freeglut.lib
glew32.lib
freetype255.lib
My #include statements look like this:
#include <windows.h>
#include <glew.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <freeglut.h>
#include <SDL.h>
#define GL_GLEXT_PROTOTYPES
#define GL_SGIX_fragment_lighting
#include "SDL_opengl.h"
Isn't glCreateShader() a standard OpenGL function that should be part of opengl32.lib?
This function is only one of many missing OpenGL functions at link time. I have another example project which links fine. It only uses GLEW, FreeGLUT and does not include SDL2 at all. Is this linker problem perhaps related to using SDL2??
Update:
I found that I had to include GLEXT.lib to get this working. The below header file inclusion also appears to work and is tidier as per what derhass was suggesting (ie. SDL_opengl.h is used instead of the regular gl.h):
#include <windows.h>
#include <glew.h>
#include "SDL_opengl.h"
#include <gl\glu.h>
#include <freeglut.h>