Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm going to buy an OpenGL book from Amazon but there are different versions for OpenGL 2, 3 and 4. Which one does G++ use?

share|improve this question

g++ is the C++ compiler of the GNU Compiler Collection (GCC). The compiler itself does not come with any OpenGL library.

You download OpenGL development libraries from the repository then you compile your program.

To get the OpenGL development library is in the package libgl1-mesa-dev. It has support for OpenGL 2.1 and some of the extensions from OpenGL 3. The next version of Mesa will likely support OpenGL 3.

To fetch it run sudo apt-get install libgl1-mesa-dev.

share|improve this answer

This does not actually depend on your compiler, but on the type of OpenGL library you are using. On *ubuntu, you may want to use the free mesa library, which is availiable in the package repositories (look for libgl1-mesa-dev). I recommend installing the freeglut package, which additionally provides some really good tools working with opengl.

According to the release notes, mesa currently (v. 7.11) supports OpenGL 2.1 as well as some extensions from level 3 and 4.

Also, make sure that your graphics card supports the version of the standard. While OpenGL 3 is supported by most graphics cards today, OpenGL 4 is only available on modern cards.

share|improve this answer

I'm thinking there are no OpenGL1; 2; 3; 4.. I only now OpenGL; OpenHL; OpenCL; OpenAL; OpenClusterGL; OpenXL. But: Open__ is only a special 3D-Renderer. So you can config it whit the videocart-driver. I'm not shure and information are from the Internet, so.....NO WARANTY!!!

share|improve this answer
This is difficult to understand. Please elaborate. – hexafraction Jul 19 '12 at 12:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.