error: GL/gl.h: No such file or directory

When compling the Qt based program on Ubuntu, following error is shown

/home/gbstack/app/Qt/5.15.2/gcc_64/include/QtGui/qopengl.h:141: error: GL/gl.h: No such file or directory
In file included from ../../../app/Qt/5.15.2/gcc_64/include/QtGui/qopengltexture.h:47,
from ../../../app/Qt/5.15.2/gcc_64/include/QtGui/QOpenGLTexture:1,
from ../../QtScrcpy/QtScrcpy/device/render/qyuvopenglwidget.cpp:2:
../../../app/Qt/5.15.2/gcc_64/include/QtGui/qopengl.h:141:13: fatal error: GL/gl.h: No such file or directory
141 | # include <GL/gl.h>
| ^~~~~

I tried apt install libopengl-dev but it doesn't work.

Solution

apt install libgl-dev