fatal error C1189: #error : gl.h included before

Hi

I have this error while compiling opengl program:

fatal error C1189: #error : gl.h included before glew.h

glew.h is included in only one file and I put the include at the top of all the other includes, there is no other file with glew include.

any one have had this error or know how to get rid of it ??

thanks in advance

If you are using Visual Studio you can use /showIncludes

to track down which file is including gl.h

Thank you very much

I tacked all the included files and found that stdafx.h includes includes gl.h , while glew.h in included after stdafx.h in another file so I put glew.h before stdafx.h. the error disappeared but I had a new lovely error and I dont know if it is related to the previous one or no, the error is:

fatal error LNK1181: cannot open input file ‘C:\Program.obj’

i included the path to the library in the linker>general> additional library dictionary and in the linker>input > additional dependencies at the same time and removed the REad-only from all the c files, but in vain. teh same error.

I would be grateful to hear your opinion again. many thanks

I removed the path to the library from the linker> input and put it in general. the error disappear. I hope to be able to go on now.

many thanks Budric for help