8

I am trying to install freeglut on my computer running Linux Mint. I follow the steps on this website: http://freeglut.sourceforge.net/docs/install.php. When I do make all in the src directory, it gives the following error:

fatal error: GL/gl.h

This error was given by ../include/GL/freeglut_std.h. Upon inspection, the include/GL directory is indeed devoid of any gl.h file. It is also missing glu.h, which freeglut_std.h also tries to #include. What should I do about this? Why are gl.h and glu.h missing?

genpfault
  • 51,148
  • 11
  • 85
  • 139
rurouniwallace
  • 2,027
  • 6
  • 25
  • 47
  • 1
    Did you run `make` before or after the [`configure`](http://en.wikipedia.org/wiki/Configure_script_%28computing%29) script? `configure` should have informed you of the missing headers. – genpfault Jul 03 '12 at 20:31

2 Answers2

10

I'd recommend installing the freeglut3-dev package instead of building from source. That will give you useful stuff like automatic updates and proper pkg-config entries that you can reference in your makefiles.

If you're dead-set on building freeglut from source you'll probably need the libgl1-mesa-dev and (maybe) libglu1-mesa-dev packages.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 1
    so what are freeglut3-dev and pkg-config? How do I install freeglut3-dev once I've downloaded it? And how does pkg-config assist in installing freeglut? – rurouniwallace Jul 03 '12 at 21:01
  • 1
    `freeglut3-dev` is a Debian [package](http://packages.debian.org/squeeze/freeglut3-dev) name. Mint is Debian/Ubuntu-based. You should be able to install it via `sudo apt-get install freeglut3-dev`. – genpfault Jul 03 '12 at 21:21
  • As the linked Wiki article says: "pkg-config is computer software that provides a unified interface for querying installed libraries for the purpose of compiling software from its source code." – genpfault Jul 03 '12 at 21:25
  • 1
    `pkg-config` won't assist in installing `freeglut` though it will assist in *using* it. – genpfault Jul 03 '12 at 21:29
  • 2
    It [doesn't seem](http://stackoverflow.com/questions/33017325/why-freeglut3-dev-doesnt-provide-pc-file-for-pkg-config) to be true on *Linux Debian*. There is no [.pc](http://people.freedesktop.org/~dbn/pkg-config-guide.html#concepts) file in [freeglut3-dev](https://packages.debian.org/squeeze/freeglut3-dev) package for [pkg-config](https://en.wikipedia.org/wiki/Pkg-config). – patryk.beza Oct 08 '15 at 13:46
6

For installing :

  1. sudo apt-get install freeglut3 freeglut3-dev libglew-dev
  2. sudo apt-get install mesa-utils

For linking :

 g++ .... -lglut -lGL ....
4b0
  • 21,981
  • 30
  • 95
  • 142
Mhadhbi issam
  • 197
  • 3
  • 6