PDA

View Full Version : fatal error C1189: #error : gl.h included before



Selina
05-26-2010, 01:39 PM
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

Budric
05-26-2010, 01:54 PM
If you are using Visual Studio you can use /showIncludes
http://msdn.microsoft.com/en-us/library/hdkef6tk%28v=VS.100%29.aspx
to track down which file is including gl.h

Selina
05-26-2010, 02:12 PM
If you are using Visual Studio you can use /showIncludes
http://msdn.microsoft.com/en-us/library/hdkef6tk%28v=VS.100%29.aspx
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

Selina
05-26-2010, 02:21 PM
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