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

  • 1 介绍
  • 2 分析
  • 3 操作步骤
    • 3.1 切换apt-get源
    • 3.2 安装
    • 3.3 运行
  • 参考

1 介绍

环境:ubuntu系统 + Qt 5.9
Qt开发用到 OpenGL,然后程序编译时报错,error: GL/gl.h: No such file or directory,显示找不到该文件。

2 分析

  • GL/gl.h 是ubuntu中库文件,需要安装。
  • GL/gl.h和x11相关,即 sudo apt-get install build-essential
  • apt-get和aptitude
    ubuntu安装软件时出现The following packages have unmet dependencies,有依赖关系。即安装opengl的依赖,显示底层的库版本过低。ubuntu16,多见这问题,底层库版本有冲突,可以用aptitude代替apt-get。
    aptitude工具能处理版本冲突的问题。
  • ubuntu16源的问题
    配置阿里的源,Ubuntu下安装APP遇到依赖模块版本不对,一般是16.04版本,给配置了其它版本的源导致。

3 操作步骤

3.1 切换apt-get源

切换到阿里的源

sudo vim /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

3.2 安装

udo apt-get install build-essential
sudo apt-get install build-essential libgl1-mesa-dev
sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev
sudo apt-get install libglfw3-dev libglfw3

3.3 运行

上述操作完,运行就行。

参考

1、OpenGL Programming/Installation/Linux
2、Ubuntu 16.04 安装OpenGL & 运行第一个demo–阿里源
3、Ubuntu16.04安装opengl

error: GL/gl.h: No such file or directory相关推荐

  1. OpenGL开发时,fatal error C1083: 无法打开包括文件:“gl\glut.h”: No such file or directory...

    本人使用的是vs2012,编写一个简单的opengl程序,运行的时候总是提示: fatal error C1083: 无法打开包括文件:"gl/glut.h": No such f ...

  2. Qt之opengl:错误: 无法打开包括文件:“gl/glut.h”: No such file or directory

    我使用的是vs2008,相信vs2005应该跟这个步骤差不多,运行的时候总是提示: fatal error C1083: 无法打开包括文件:"GL/glut.h": No such ...

  3. opengl:错误: 无法打开包括文件:“gl/glut.h”: No such file or directory

    我使用的是vs2008,相信vs2005应该跟这个步骤差不多,运行的时候总是提示: fatal error C1083: 无法打开包括文件:"GL/glut.h": No such ...

  4. glut 配置,解决“gl/glut.h”: No such file or directory

    glut 配置 glut下载 配置 计算机图形学上机用到了,给vs2013配置glut 解决"gl/glut.h": No such file or directory的问题 gl ...

  5. 报错解决:fatal error: json/json.h: No such file or directory

    晚上在做编译原理作业的时候遇到了报错: ASTNodes.h:6:23: fatal error: json/json.h: No such file or directory#include < ...

  6. linux 内核编译 错误 fatal error: linux/compiler-gcc6.h: No such file or directory

    在交叉编译i.MX6UL的Kernel代码时出现这个错误 CHK include/config/kernel.release  Using .. as source for kernel  GEN . ...

  7. 在Jetson Xavier NX上安装torchvision编译报错:fatal error: libavcodec/avcodec.h: No such file or directory

    文章目录: 1 问题原因说明 2 解决方法 1 问题原因说明 1.尝试安装torchvision 在Jetson NX设备上安装torch的版本是1.6.0版本,对应安装torchvision版本应该 ...

  8. 【错误记录】编译 Linux 内核报错 ( fatal error: openssl/opensslv.h: No such file or directory )

    文章目录 一.报错信息 二.解决方案 一.报错信息 编译 Linux 内核 , 执行 sudo make 命令 , 开始正式编译 Linux 内核 , 报如下错误 : root@ubuntu:~/ke ...

  9. 【错误记录】编译 ijkplayer 报错 (fatal error: ijksoundtouch/ijksoundtouch_wrap.h: No such file or directory )

    文章目录 一.报错信息 二.解决方案 参考 https://github.com/bilibili/ijkplayer 项目的编译过程 ; 一.报错信息 在编译完 ffmpeg 之后 , 执行 ./c ...

  10. BRCM5.02编译五: fatal error: uuid/uuid.h: No such file or directory compilation terminated

    现象: Checking automake version: 1.13.4 Checking autoconf version: 2.69 Checking libtoolize version: 2 ...

最新文章

  1. 利用Switch实现两台计算机通信
  2. 23 Merge k Sorted Lists
  3. python py生成及调用pyd(so)文件
  4. vue 部门tree样式_vue+Element实现tree树形数据展示
  5. CodeForces - 1417E XOR Inverse(字典树求逆序对+分治)
  6. java 浮点型 除零_Java-非零整数除以10等于0.0浮点?
  7. 三星active2怎么连接手机_手机怎么连接隐藏的wifi无线网络
  8. linux下的C语言开发(进程创建)
  9. hadoop使用场景
  10. [hiho1160] 攻城略地
  11. python快速开发 数据管理网站_GitHub - AngelLiang/kingWeb: Python django后台快速开发框架...
  12. 关于fork()父子进程返回值的问题
  13. ProcExp的利用
  14. c++复习日记3 模板和流
  15. SPSS Modeler18.0数据挖掘软件教程(六):聚类分析-K-means
  16. 英语b计算机考试时间2015年,2014年12月大学英语B 计算机应用基础考试工作安排...
  17. python的词性标注
  18. Deepin双系统找不到Windows启动项
  19. 如何策划设计作品 设计的本质 所谓设计
  20. 苹果mac下载了dms文件怎么办?

热门文章

  1. mysql 通用造数据脚本
  2. 【编程实践】谈谈高质量代码的“6大支柱”
  3. centos DNS问题(只能ping通IP域名白费)
  4. 【Go语言刷题篇】Go完结篇|函数、结构体、接口、错误入门学习
  5. JAVA查询天气预报
  6. 智能音箱终于秀得起音质了……
  7. 计算机网络形考作业三,电大-计算机网络形考作业3
  8. 产品运营怎么做规划?
  9. 算法学习 - 最长公共子序列(LCS)C++实现
  10. ADF检验(statsmodels.tsa.stattools.adfuller())