glGetError returns an error before any openGL call ?

Hello everybody,

a simple call to glGetError just at the beginning of my main function informs me
of an “invalid operation”. It’s very surprising because I haven’t got any static
data that could call gl functions.
I’m including glh_extensions.h, cg.h cgGL.h
and glut.h.
Any idea about this strange behavior ?

Escondida

Since glGetError() is also an OpenGL call it requires a valid rendering context.