In your source file, you didn't include the opengl header. Without it, i get a bunch of errors too, but with it, your code compiles.

#include <gl/gl.h>

That work?