在 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

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

installing Freeglut on Linux

linuxopenglinstallfreeglutlinux-mint

提问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 allin 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-devpackage instead of building from source. That will give you useful stuff like automatic updates and proper pkg-configentries that you can reference in your makefiles.

我建议安装freeglut3-dev软件包而不是从源代码构建。这将为您提供有用的东西,例如自动更新和pkg-config您可以在make文件中引用的正确条目。

If you're dead-set on building freeglut from source you'll probably need the libgl1-mesa-devand (maybe) libglu1-mesa-devpackages.

如果您对从源代码构建 freeglut 死心塌地,您可能需要libgl1-mesa-dev和(也许)libglu1-mesa-dev包。

回答by Issam mhedhebi

For installing :

安装:

  1. sudo apt-get install freeglut3 freeglut3-dev libglew-dev
  2. sudo apt-get install mesa-utils
  1. sudo apt-get install freeglut3 freeglut3-dev libglew-dev
  2. sudo apt-get install mesa-utils

For linking :

链接:

 g++ .... -lglut -lGL ....