Lighting not working

i did this:


GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f }; 
GLfloat LightPosition[]= { 0.0f, 0.0f, 2.0f, 1.0f };
glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);

but i get this error:


sample252.c:33: error: expected declaration specifiers or ‘...’ before numeric constant
sample252.c:33: error: expected declaration specifiers or ‘...’ before numeric constant
sample252.c:33: error: expected declaration specifiers or ‘...’ before ‘LightAmbient’
sample252.c:33: warning: data definition has no type or storage class
sample252.c:33: error: conflicting types for ‘glLightfv’
/usr/include/GL/gl.h:1438: error: previous declaration of ‘glLightfv’ was here

whats wrong??

Looks like the gl header inclusion did not succeed for a reason I ignore…

Could we see the preprocessor part of the code?