Posts Tagged ‘glut.h’

Making glut.h work in Fedora 11

November 2nd, 2009 3 comments

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:


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.

I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).