Linux 缺少编译 OpenGL 程序 GL/glew.h

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15852417/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 22:39:36  来源:igfitidea点击:

compiling OpenGL program GL/glew.h missing

linuxopenglglew

提问by Ataraxia

I installed OpenGL onto my computer running Linux Mint following the instructions on this tutorial. I am trying to compile a program that uses OpenGL, but I'm getting a compile error: fatal error: GL/glew.h: No such file or directory. I check the /usr/include/GL folder, and glew.h is indeed missing. I don't know why it's missing, because I did the command sudo apt-get install libglew1.5and it gives the output:

我按照本教程中的说明将 OpenGL 安装到运行 Linux Mint 的计算机上。我正在尝试编译一个使用 OpenGL 的程序,但出现编译错误:fatal error: GL/glew.h: No such file or directory. 我检查了/usr/include/GL 文件夹,确实缺少glew.h。我不知道为什么它会丢失,因为我执行了命令sudo apt-get install libglew1.5并给出了输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libglew1.5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 465 not upgraded.

Why is the glew.h file missing?

为什么缺少glew.h 文件?

采纳答案by datenwolf

libglewis just the library, but not the development files (headers). You need to install those separately. The package name on Debian based systems is libglew-devand for fedora(and possibly its derivatives) it is glew-devel

libglew只是库,而不是开发文件(头文件)。您需要单独安装它们。基于 Debian 的系统上的软件包名称libglew-devglew-devel

回答by androidwifi

Add following commands:

添加以下命令:

sudo apt-get install libglew-dev