抱歉,问题很简单:我需要安装哪些软件包才能使 OpenGL 正常工作(包括构建使用 OpenGL 的程序)?
(我使用的是 Ubuntu 20.04 LTS。没有 opengl、openGL 或 mesa 这样的包。)
答案1
我相信对于 20.04 来说,开发包(构建使用 OpenGL 的程序所需)是libgl-dev
:
$ apt show libgl-dev
Package: libgl-dev
Version: 1.3.2-1~ubuntu0.20.04.1
Priority: optional
Section: libs
Source: libglvnd
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian X Strike Force <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1389 kB
Depends: libgl1 (= 1.3.2-1~ubuntu0.20.04.1), libglx-dev
Breaks: libgl1-mesa-dev (<< 20.0.8-0ubuntu1~20.04), libglvnd-dev (<< 1.3.0-1), mesa-common-dev (<< 20.0.8-0ubuntu1~20.04)
Replaces: libgl1-mesa-dev (<< 20.0.8-0ubuntu1~20.04), libglvnd-dev (<< 1.3.0-1), mesa-common-dev (<< 20.0.8-0ubuntu1~20.04)
Homepage: https://gitlab.freedesktop.org/glvnd/libglvnd
Download-Size: 97.8 kB
APT-Sources: http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
Description: Vendor neutral GL dispatch library -- GL development files
This is an implementation of the vendor-neutral dispatch layer for
arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
.
This package provides the development environment for compiling programs
against the GL library.
以前的版本明确使用了 Mesa 实现,即libgl1-mesa-dev
。