I have an app in c# and I want to compile with cl.exe an opengl - cpp file. When I try to compile I always get the error GL/GLUT.h: No such file or directory. I tried to put both gl.h and glut.h in the same folder as the cpp file but nothing. Also, before #include <GL/GLUT.h>
, is #include <GL/GL.h>
, but this is ok...it shouldn't give me an error for gl.h first? Can anyone tell me what the problem is?
Asked
Active
Viewed 542 times
0

Olga Anastasiadou
- 143
- 5
- 20
-
Check out [this question](http://stackoverflow.com/questions/19858072/opengl-gl-glut-h-no-such-file-or-directory) and see if it has your answer – techvice May 01 '14 at 20:47
-
I don't use MinGW. I use Visual Studio. Though I followed some of the steps (put the glut32.dll in c:/windows/system32) and now I get the same error for gl.h...I'm driving crazy..I put the dll and in my current folder...the same again.. – Olga Anastasiadou May 01 '14 at 21:06
-
Where exactly is the GLUT.h file? – Mats Petersson May 01 '14 at 22:08
-
I put it in the same folder as my cpp file – Olga Anastasiadou May 01 '14 at 22:20
1 Answers
0
If you are putting them in same folder then you have to write your include statement like this
#include "glut.h"
You dont need to include gl.h as glut will do that for you.

Abhishek Bansal
- 5,197
- 4
- 40
- 69
-
I did this and it worked! But now I get a linker error. It cannot open glut32.lib, which is also in my current folder. – Olga Anastasiadou May 02 '14 at 05:35
-
you need to link glut32.lib in project properties linker options or write `#pragma "glut32.lib"` in your main.cpp for a quick and dirty solution – Abhishek Bansal May 02 '14 at 05:38
-
-