openGL errors

I check for errors using
if((error = glGetError()) != GL_NO_ERROR)
{
errString = gluErrorString(error);
fprintf(stderr, "OpenGL Error: %s
", errString);
}

I get an invalid value but I have no idea where it is comming from. What does the invalid value string mean and is there a way to check where it is comming from in my code? Im sure the answer is no but mabey there is something im not aware of.

Place glGetError’s all over your program and use a debugger to see where it returns the error.

Start by placing them after bigger blocks, like the initialization function, the display function, and so on, to know which part it’s comming from. Then you continue with smaller and smaller blocks until the error is found.

ok thanks