PDA

View Full Version : ERROR: Missing GL version



Brooksy
03-06-2006, 12:06 PM
I'm a beginner programmer trying to get my first shader to run in my OpenGL application.

I have included <GL/glew.h> (before glut), installed the dll file into SYSTEM32, the glew32.lib in LIB and glew32.h etc in include. I have also set linker to read glew32.lib

I run this code in my main function to identify the problem:

/************************************************** ***********/

int main(int argc, char *argv[])
{
glutInit(&argc, argv);

glewInit();
GLenum err = glewInit();
if (GLEW_OK != err)
{
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}
fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));

...etc etc...(but it doesn't get this far)

it returns the error message:

ERROR: Missing GL version

I'm really stuck as what to do now, any help would be much appreciated.

Thanks :confused:

k_szczech
03-06-2006, 12:54 PM
You have to initialize glew after you have created OpenGL context.
So you must initialize glut, create window, and then initialize glew.

Brooksy
03-06-2006, 03:31 PM
That's brilliant! It worked, thankyou very much for that tip.