My system for Ubuntu14.04, with Apt-get installed the implementation of OpenGL MESA,QT is the official website to download the run file to install.
OK, now two are all there, so try to write OpenGL code under QT.
Before trying to paste the code in vim and then compile, the test succeeds is a statement containing one of the following compilation options.
1 GCC
But directly paste the code into the QT creator Click Run, but there are multiple error messages, the call function is not found, that is, QT has not been connected to use the installed OpenGL library.
Many of the solutions on the Web have been added to the QT project's. Pro file:
Plus QT + + OpenGL
There are also additional config+= qt OpenGL warn_on release
Finally, I found this sentence. LIBS =-lopengl32-lglut32-lglut-lglu32
The first two experiments proved to be invalid, or to solve the problem does not play a role, the latter reminds me of the above compiler statements in the options, and then change those options to the above compilation statement options:
That is, you just need to add this line:
1 LIBS =-lgl-lglu-lglut
Then the run succeeds and the problem is resolved.
QT cannot use OpenGL solution after installing QT and OpenGL under Linux