Home > Fedora, Free Software, Open Source Software, Tyler B > Making glut.h work in Fedora 11

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:


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.

  1. Jon F
    November 3rd, 2009 at 14:34 | #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. Tyler B
    November 3rd, 2009 at 15:33 | #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.

  3. Jon F
    November 4th, 2009 at 09:40 | #3

    Screw Java – that is truly cross platform code!

  1. January 1st, 2010 at 15:46 | #1