![如何在 Linux Mint 上成功安装 GLFW?](https://linux22.com/image/90628/%E5%A6%82%E4%BD%95%E5%9C%A8%20Linux%20Mint%20%E4%B8%8A%E6%88%90%E5%8A%9F%E5%AE%89%E8%A3%85%20GLFW%EF%BC%9F.png)
我相信我正处于依赖地狱中。
我正在努力让 GLFW 正常工作。我使用的是 Linux Mint with Cinnamon。当我尝试使用编译 GLFW 时这些步骤,我得到以下输出:
$ cmake -G "Unix Makefiles"
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using X11 for window creation
-- Configuring done
-- Generating done
-- Build files have been written to: ~/Downloads/glfw
$ make
[ 20%] Building C object src/CMakeFiles/glfw.dir/context.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/init.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/input.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/monitor.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/vulkan.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/window.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/x11_init.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/x11_monitor.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/x11_window.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/xkb_unicode.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/linux_joystick.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/posix_time.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/posix_tls.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/glx_context.c.o
[ 20%] Building C object src/CMakeFiles/glfw.dir/egl_context.c.o
Linking C shared library libglfw.so
[ 20%] Built target glfw
[ 20%] Building C object examples/CMakeFiles/boing.dir/boing.c.o
In file included from ~/Downloads/glfw/examples/boing.c:40:0:
~/Downloads/glfw/include/GLFW/glfw3.h:168:21: fatal error: GL/gl.h: No such file or directory
#include <GL/gl.h>
^
compilation terminated.
make[2]: *** [examples/CMakeFiles/boing.dir/boing.c.o] Error 1
make[1]: *** [examples/CMakeFiles/boing.dir/all] Error 2
make: *** [all] Error 2
根据这,这个有关系mesa-common-dev
。
当我尝试安装时mesa-common-dev
,我得到以下输出:
$ sudo apt-get install mesa-common-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
mesa-common-dev : Depends: libdrm-dev (>= 2.4.52) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
显然这与此有关漏洞在 Linux Mint 中。根据这个答案,解决方案是继续尝试安装依赖项,直到用完并找到丢失的依赖项。
试过了。这是最终的大命令及其输出:
$ sudo apt-get install build-essential libevent-pthreads-2.0.5 doxygen xorg-dev libglu1-mesa-dev xserver-xorg-dev mesa-common-dev libdrm-dev libdrm2="2.4.64-1~ubuntu14.04.1" libdrm-intel1="2.4.64-1~ubuntu14.04.1" libdrm-nouveau2="2.4.64-1~ubuntu14.04.1" libdrm-radeon1="2.4.64-1~ubuntu14.04.1" libgbm1 libdrm2:i386="2.4.64-1~ubuntu14.04.1"
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libevent-pthreads-2.0-5' for regex 'libevent-pthreads-2.0.5'
build-essential is already the newest version.
libgbm1 is already the newest version.
The following packages were automatically installed and are no longer required:
cheese-common gnome-video-effects
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libdmx-dev libdrm-amdgpu1 libegl1-mesa libevent-core-2.0-5 libfontenc-dev
libfs-dev libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx
libgl1-mesa-glx:i386 libglapi-mesa libglapi-mesa:i386 libgles2-mesa
libllvm3.4 libmirclient-dev libmirclient7 libmirclientplatform-mesa
libmirprotobuf-dev libmirprotobuf0 libpciaccess-dev libwayland-egl1-mesa
libx11-xcb-dev libxaw7-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev
libxcb-present-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev
libxcb-xfixes0-dev libxfont-dev libxkbfile-dev libxmu-dev libxmu-headers
libxmuu-dev libxres-dev libxshmfence-dev libxss-dev libxtst-dev libxv-dev
libxvmc-dev libxxf86dga-dev libxxf86vm-dev mircommon-dev
x11proto-bigreqs-dev x11proto-dmx-dev x11proto-dri2-dev x11proto-dri3-dev
x11proto-fonts-dev x11proto-gl-dev x11proto-present-dev x11proto-record-dev
x11proto-resource-dev x11proto-scrnsaver-dev x11proto-video-dev
x11proto-xcmisc-dev x11proto-xf86bigfont-dev x11proto-xf86dga-dev
x11proto-xf86dri-dev x11proto-xf86vidmode-dev xserver-xorg xserver-xorg-core
xserver-xorg-input-evdev
Suggested packages:
doxygen-latex doxygen-doc doxygen-gui graphviz libglide3 libxaw-doc
The following packages will be REMOVED:
caribou cheese cinnamon gir1.2-clutter-1.0 gir1.2-clutter-gst-2.0
gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gir1.2-gtkclutter-1.0 gir1.2-muffin-3.0
gir1.2-totem-1.0 gstreamer1.0-clutter ia32-libs kubuntu-desktop
libcheese-gtk23 libcheese7 libclutter-1.0-0 libclutter-gst-2.0-0
libclutter-gtk-1.0-0 libcogl-pango15 libcogl15 libdrm-intel1:i386
libdrm-nouveau2:i386 libdrm-radeon1:i386 libegl1-mesa-lts-vivid
libgbm1-lts-vivid libgl1-mesa-dri-lts-vivid libgl1-mesa-dri-lts-vivid:i386
libgl1-mesa-glx-lts-vivid libgl1-mesa-glx-lts-vivid:i386
libglapi-mesa-lts-vivid libglapi-mesa-lts-vivid:i386 libgles1-mesa-lts-vivid
libgles2-mesa-lts-vivid libmuffin0 libtotem0 libwayland-egl1-mesa-lts-vivid
libxatracker2-lts-vivid mint-meta-cinnamon mint-meta-codecs nemo-preview
totem totem-mozilla totem-plugins totem-plugins-extra virtualbox-guest-x11
xorg xserver-xorg-core-lts-vivid xserver-xorg-input-all-lts-vivid
xserver-xorg-input-evdev-lts-vivid xserver-xorg-input-mouse-lts-vivid
xserver-xorg-input-synaptics-lts-vivid xserver-xorg-input-vmmouse-lts-vivid
xserver-xorg-input-wacom-lts-vivid xserver-xorg-lts-vivid
xserver-xorg-video-all-lts-vivid xserver-xorg-video-ati-lts-vivid
xserver-xorg-video-cirrus-lts-vivid xserver-xorg-video-fbdev-lts-vivid
xserver-xorg-video-intel-lts-vivid xserver-xorg-video-mach64-lts-vivid
xserver-xorg-video-mga-lts-vivid xserver-xorg-video-neomagic-lts-vivid
xserver-xorg-video-nouveau-lts-vivid xserver-xorg-video-openchrome-lts-vivid
xserver-xorg-video-r128-lts-vivid xserver-xorg-video-radeon-lts-vivid
xserver-xorg-video-savage-lts-vivid
xserver-xorg-video-siliconmotion-lts-vivid
xserver-xorg-video-sisusb-lts-vivid xserver-xorg-video-tdfx-lts-vivid
xserver-xorg-video-trident-lts-vivid xserver-xorg-video-vesa-lts-vivid
xserver-xorg-video-vmware-lts-vivid
The following NEW packages will be installed:
doxygen libdmx-dev libdrm-amdgpu1 libdrm-dev libegl1-mesa
libevent-core-2.0-5 libevent-pthreads-2.0-5 libfontenc-dev libfs-dev
libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libgl1-mesa-glx:i386
libglapi-mesa libglapi-mesa:i386 libgles2-mesa libglu1-mesa-dev libllvm3.4
libmirclient-dev libmirclient7 libmirclientplatform-mesa libmirprotobuf-dev
libmirprotobuf0 libpciaccess-dev libwayland-egl1-mesa libx11-xcb-dev
libxaw7-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev
libxcb-present-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev
libxcb-xfixes0-dev libxfont-dev libxkbfile-dev libxmu-dev libxmu-headers
libxmuu-dev libxres-dev libxshmfence-dev libxss-dev libxtst-dev libxv-dev
libxvmc-dev libxxf86dga-dev libxxf86vm-dev mesa-common-dev mircommon-dev
x11proto-bigreqs-dev x11proto-dmx-dev x11proto-dri2-dev x11proto-dri3-dev
x11proto-fonts-dev x11proto-gl-dev x11proto-present-dev x11proto-record-dev
x11proto-resource-dev x11proto-scrnsaver-dev x11proto-video-dev
x11proto-xcmisc-dev x11proto-xf86bigfont-dev x11proto-xf86dga-dev
x11proto-xf86dri-dev x11proto-xf86vidmode-dev xorg-dev xserver-xorg
xserver-xorg-core xserver-xorg-dev xserver-xorg-input-evdev
The following packages will be DOWNGRADED:
libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libdrm2:i386
0 upgraded, 71 newly installed, 5 downgraded, 73 to remove and 1 not upgraded.
Need to get 18.2 MB of archives.
After this operation, 25.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
这看起来就像是要卸载 cinnamon 并彻底摧毁我的系统。我缺少什么?如何在 Linux Mint 17.3 上安装 GLFW?
我还进一步调查并尝试安装,xserver-xorg-core-dev-Its-vivid
但它只是说该软件包已破坏依赖项,不允许我安装。
我的系统信息:
Linux my-computer-name 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux