Installing OpenGL
sudo apt-get update
sudo apt-get install Libgl1-mesa-dev
sudo apt-get install Libglu1-mesa-dev
sudo apt-get install Freeglut3-dev
The above 3 common OpenGL development packages are installed in turn, and the relationship of 3 packages can be summarized as follows: The latter package is the previous package
Packaging, progressive, the purpose is to facilitate user development.
Verify that the OpenGL development package is installed successfully
First, you can command it by
Dpkg-l Libgl1-mesa-dev Libglu1-mesa-dev Freeglut3-dev
To see what happens after the package is installed: header files, library files, and so on, you can also view the corresponding directories directly.
Summary
If the system has all installed packages or can be installed, can not be solved by the package, you can:
Apt-cache Search < package name string >
Dpkg-l < package name string >
and other similar function commands to view.
More details about the Ubuntu package management system can be found on your own and there are many articles and blogs in this category.
OpenGL test Code (code from the network, not my original)
/* * glteapot.c */#include <gl/glut.h>void init (void) { Glclearcolor (0.0, 0.0, 0.0, 0.0); glmatrixmode (GL_PROJECTION); glortho ( -5, 5, -5, 5, 5, 15); glmatrixmode ( Gl_modelview); glulookat (0, 0, 10, 0, 0, 0, 0, 1, 0); return;} Void display (void) { glclear (gl_color_buffer_bit); glcolor3f (1.0, 0, 0); glutwireteapot (3); glflush (); return;} Int main (int argc, char *argv[]) { glutinit (&ARGC,&NBSP;ARGV); glutinitdisplaymode (Glut_rgb | glut_single); Glutinitwindowposition (0, 0); glutinitwindowsize (300, 300); glutcreatewindow ("Opengl 3d view (Teapot)"); init (); glutdisplayfunc (display); glutmainloop (); return 0;}
Compile:
Gcc-o Glteapot Glteapot.c-lgl-lglu-lglut
Operating effects such as:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/82/7C/wKiom1dWk42j7VkjAAGMiAQWagQ806.jpg "title=" Qq20160607172518.jpg "alt=" Wkiom1dwk42j7vkjaagmiaqwagq806.jpg "/>
This article is from the "Jimokuangxiangqu" blog, make sure to keep this source http://4594296.blog.51cto.com/4584296/1787046
Ubuntu 14.04.2 LTS DeskTop installation OpenGL