Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26652

Where can I get the OpenGL graphics header files?

I want to compile an OpenGL program but I don't have the necessary headers. Maybe you know how to get these?

#include <GL/glx.h>    /* this includes the necessary X headers */
#include <GL/gl.h>

#include <X11/X.h>    /* X11 constant (e.g. TrueColor) */
#include <X11/keysym.h>

It's the OpenGL example from the Codeblocks IDE that I'm trying to get running under ubuntu .

Upvotes: 0

Views: 3215

Answers (2)

Rovin Bhandari
Rovin Bhandari

Reputation: 475

I installed the following packages:

  • freeglut and freeglut-dev
  • libgl1-mesa-dev
  • libglu1-mesa and libglu1-mesa-dev
  • libgl1-mesa-glx
  • libx11-dev
  • mesa-common-dev

and all their dependencies, after which I can directly include the headers you mentioned in my C program.

If you want to know the paths of these headers, do locate gl.h, locate glx.h, locate X.h and locate keysym.h. Be sure to sudo updatedb before you use locate.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798486

The OpenGL headers are part of Mesa, and the X11 headers are in Xorg's protocol development package.

Upvotes: 3

Related Questions