DEV的[Error] gl/glut.h: No such file or directory
时间: 2024-01-02 19:20:46 浏览: 208
为解决DEV的[Error] gl/glut.h: No such file or directory问题,可以按照以下步骤进行操作:
1. 确认系统中是否已经安装了OpenGL和GLUT库,如果没有安装,需要先安装这两个库。
2. 如果已经安装了OpenGL和GLUT库,但是仍然出现了该错误,可以尝试切换apt-get源并重新安装这两个库。
3. 具体操作步骤如下:
3.1 切换apt-get源
```shell
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份源文件
sudo gedit /etc/apt/sources.list #打开源文件
```
在打开的源文件中,将原来的内容替换为以下内容:
```
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
```
保存并关闭源文件。
3.2 安装OpenGL和GLUT库
```shell
sudo apt-get update #更新源
sudo apt-get install freeglut3-dev #安装GLUT库
sudo apt-get install libgl1-mesa-dev #安装OpenGL库
```
3.3 运行
在DEV中重新编译运行程序,如果一切正常,该错误应该已经被解决了。
阅读全文