在 Linux 上安装 Freeglut
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11318510/
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
installing Freeglut on Linux
提问by Ataraxia
I am trying to install freeglut on my computer running Linux Mint. I follow the steps on this website: http://freeglut.sourceforge.net/docs/install.php. When I do make all
in the src directory, it gives the following error:
我正在尝试在运行 Linux Mint 的计算机上安装 freeglut。我按照本网站上的步骤操作:http: //freeglut.sourceforge.net/docs/install.php。当我make all
在 src 目录中执行时,它会出现以下错误:
fatal error: GL/gl.h
fatal error: GL/gl.h
This error was given by ../include/GL/freeglut_std.h. Upon inspection, the include/GL directory is indeed devoid of any gl.h file. It is also missing glu.h, which freeglut_std.h also tries to #include
. What should I do about this? Why are gl.h and glu.h missing?
这个错误是由 ../include/GL/freeglut_std.h 给出的。经过检查,include/GL 目录确实没有任何 gl.h 文件。它还缺少 glu.h,而 freeglut_std.h 也试图这样做#include
。我该怎么办?为什么缺少 gl.h 和 glu.h?
采纳答案by genpfault
I'd recommend installing the freeglut3-dev
package instead of building from source. That will give you useful stuff like automatic updates and proper pkg-config
entries that you can reference in your make
files.
我建议安装freeglut3-dev
软件包而不是从源代码构建。这将为您提供有用的东西,例如自动更新和pkg-config
您可以在make
文件中引用的正确条目。
If you're dead-set on building freeglut from source you'll probably need the libgl1-mesa-dev
and (maybe) libglu1-mesa-dev
packages.
如果您对从源代码构建 freeglut 死心塌地,您可能需要libgl1-mesa-dev
和(也许)libglu1-mesa-dev
包。
回答by Issam mhedhebi
For installing :
安装:
sudo apt-get install freeglut3 freeglut3-dev libglew-dev
sudo apt-get install mesa-utils
sudo apt-get install freeglut3 freeglut3-dev libglew-dev
sudo apt-get install mesa-utils
For linking :
链接:
g++ .... -lglut -lGL ....