Estou executando o Ubuntu 14.04 de 64 bits.
O erro de compilação que estou recebendo é:
In file included from ../../../Qt/5.4/gcc_64/include/QtOpenGL/qgl.h:39:0,
from ../../../Qt/5.4/gcc_64/include/QtOpenGL/qglshaderprogram.h:37,
from ../../../Qt/5.4/gcc_64/include/QtOpenGL/QGLShaderProgram:1,
from glwidget.h:5,
from glwidget.cpp:1:
../../../Qt/5.4/gcc_64/include/QtGui/qopengl.h:122:21: fatal error: GL/gl.h: No such file or directory
# include <GL/gl.h>
^
Estranhamente, parece que o libGL.so foi instalado e vinculado adequadamente às bibliotecas OpenGL instaladas pelo meu driver de vídeo Nvidia 343 (que eu presumo também instala drivers OpenGL).
$ ls -l /usr/lib | grep -i libgl
lrwxrwxrwx 1 root root 17 Jan 15 12:47 libGLESv1_CM.so -> libGLESv1_CM.so.1
lrwxrwxrwx 1 root root 22 Jan 15 12:47 libGLESv1_CM.so.1 -> libGLESv1_CM.so.343.36
-rwxr-xr-x 1 root root 48248 Jan 15 12:47 libGLESv1_CM.so.343.36
lrwxrwxrwx 1 root root 14 Jan 15 12:47 libGLESv2.so -> libGLESv2.so.2
lrwxrwxrwx 1 root root 19 Jan 15 12:47 libGLESv2.so.2 -> libGLESv2.so.343.36
-rwxr-xr-x 1 root root 62352 Jan 15 12:47 libGLESv2.so.343.36
-rw-r--r-- 1 root root 654 Jan 15 12:47 libGL.la
lrwxrwxrwx 1 root root 10 Jan 15 12:47 libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root 15 Jan 15 12:47 libGL.so.1 -> libGL.so.343.36
-rwxr-xr-x 1 root root 1274520 Jan 15 12:47 libGL.so.343.36
Eu vi alguns posts anteriores que sugerem fazer
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
mas quando tentei isso, ele rebaixou minha versão do OpenGL suportada (como gerada pelo glxinfo) para a v1.4. Também não sei por que isso deve ajudar.
Aqui está a minha saída glxinfo.
$ glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 970/PCIe/SSE2
OpenGL core profile version string: 4.3.0 NVIDIA 343.36
OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.4.0 NVIDIA 343.36
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
obrigado
mesa-common-dev
pacote instalado?