注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
lcofjp的个人空间 https://home.eeworld.com.cn/space-uid-367757.html [收藏] [复制] [分享] [RSS]
日志

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

已有 4929 次阅读2016-5-1 21:28 |个人分类:linux/unix| include, error, file

/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 command

yum 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.



评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章