GL/gl.h: No such file or directory 解决办法

/home/xxxx/Qt5.6.0/5.6/gcc_64/include/QtGui/qopengl.h:120: error: GL/gl.h: No such file or directory

我在ubuntu上安装了qt5.6,然后编译demo的时候提示上述错误,搜索到了解决办法:

Linux
OpenGL support is very easy to enable on current Linux distributions. For distributions derived from RedHat Linux, the libraries and header files are installed using the commandyum install freeglut-devel
Since GLUT depends on OpenGL and a number of other libraries, installing GLUT will trigger the dependencies needed to install everything else. For distributions derived from Debian such as Ubuntu, the installation command is
apt-get install freeglut3-dev
To compile and link your program on Ubuntu 14 based distros you need to explicitly grab every library using
gcc -o foo foo.c -lglut -lGLU -lGL -lm
I recommend that you use this full version even if not required on your system. Older distributions may put the files in /usr/X11R6, in which case you need to add -I and -L flags to pick up the header files and libraries.
Once installed, run the glxinfo program and look for direct rendering in the output. If the result is YES, then hardware support for OpenGL is working. If it is NO, some things are done in software and you may take a performance hit. Depending on your hardware, you may want to work on your X server. Specifically, the nVidia and AMD/ATI web sites contains updated drivers that result in improved performance over the stock Xorg drivers.
The compiz window manager (which is an OpenGL window manager) makes applications which use glutIdleFunc() run jerky unless you enable VSync. This seems to be an issue especially with newer Ubuntu installs.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值