It's a common error, to start accessing OpenGL functions before you activate a working rendering context.