Making glut.h work in Fedora 11

As part of a computer graphics course I am taking at university I need to be able to develop C/C++ applications using openGL and the openGL Utility Toolkit (GLUT). I tried using many different C/C++ IDEs, including Eclipse, before I finally settled on MonoDevelop as my IDE of choice. After trying for some time to get this to work in a way similar to what I am used to on Windows, I finally gave up on the compilation errors and consulted the GOOG. As this all actually happened about 2 weeks ago I am a little cloudy where I discovered this tidbit of information but it turns out that even after you install freeglut through yum,

sudo yum install freeglut freeglut-devel

it doesn’t actually register the glut.h library correctly. Unfortunately due to the aforementioned registration issue, MonoDevelop was unable to load glut.h. I was able to rectify this by creating my own pkgconfig file, glut.pc, and placing it under /usr/lib64/pkgconfig.

Here is what I placed in my custom created glut.pc file that seemed to do the job:

prefix=/usr/include
exec_prefix=${prefix}
libdir=/usr/include/GL
includedir=/usr/include

Name: glut
Description: Mesa OpenGL Utility Toolkit library
Requires: gl glu
Version: 7.6.0
Libs: -L${libdir} -lglut
Cflags: -I${includedir}

So yeah, that’s it! This seems to be a very common problem so hopefully what I have described here works for you as well.




3 Comments

  1. So how has your experience been so far with OpenGL/C++ programming on Linux? And have you managed to get your code to work on Windows without many changes?

  2. Thanks to the lack of any Windows specific libraries (like windows.h) my code is 100% portable between Windows and Linux. I just need to compile it on each to get it to work.

1 Trackback / Pingback

  1. The end of the long road | The Linux Experiment

Leave a Reply

Your email address will not be published.


*