View Full Version : OpenGL not working

21st November 2006, 12:09 PM
I'm following this tutorial:


To set up my OpenGL environment for Unix/Linux.

I typed both the main.cpp and MakeFile.

After the two files were typed, I use the shell to:


and this error comes up:

make: *** No targets specified and no makefile found. Stop.

So I changed the name of the MakeFile to makefile and tried the command make again, this came up:

main.cpp:1:21: error: GL/glut.h: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:5: error: ‘glutinit’ was not declared in this scope
main.cpp:7: error: ‘GL_LIGHTING’ was not declared in this scope
main.cpp:7: error: ‘glEnable’ was not declared in this scope

When I download the source file from the author, which also contained two extra files in addition to the main.cpp and MakeFile. The two files were an executable main program and a read me file.

When I use the make command using the author's files, the MakeFile works. When I delete the author's main executable program and try to make again, the stupid program doesn't compile!

Any ideas?

21st November 2006, 12:21 PM
Install the freeglut and freeglut-devel packages from Fedora Extras.

21st November 2006, 01:01 PM
OK, I've followed your suggestion and installed freeglut-devel package and it works. I can now compile my program so as long as I include these flags:

[chuong@mycomputer ~]$ gcc -o main main.cpp -lGL -lGLU -lglut

Thank you markkuk