安装 lablgtk 时遇到问题
Posted
技术标签:
【中文标题】安装 lablgtk 时遇到问题【英文标题】:Trouble installing lablgtk 【发布时间】:2016-10-17 05:41:08 【问题描述】:我在。当我输入opam install lablgtk
The following actions will be performed:
∗ install lablgtk 2.18.5
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ????
[lablgtk] Archive in cache
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ????
[ERROR] The compilation of lablgtk failed at "./configure --prefix
/Users/name/.opam/4.03.0
LABLGLDIR=/Users/name/.opam/4.03.0/lib/lablgl".
Processing 1/1: [lablgtk: ocamlfind remove]
#=== ERROR while installing lablgtk.2.18.5 ====================================#
# opam-version 1.2.2
# os darwin
# command ./configure --prefix /Users/name/.opam/4.03.0 LABLGLDIR=/Users/name/.opam/4.03.0/lib/lablgl
# path /Users/name/.opam/4.03.0/build/lablgtk.2.18.5
# compiler 4.03.0
# exit-code 1
# env-file /Users/name/.opam/4.03.0/build/lablgtk.2.18.5/lablgtk-9935-1872ec.env
# stdout-file /Users/name/.opam/4.03.0/build/lablgtk.2.18.5/lablgtk-9935-1872ec.out
# stderr-file /Users/name/.opam/4.03.0/build/lablgtk.2.18.5/lablgtk-9935-1872ec.err
### stdout ###
# [...]
# checking whether we are using the GNU C compiler... yes
# checking whether gcc accepts -g... yes
# checking for gcc option to accept ISO C89... none needed
# checking whether C compiler accepts -fno-unwind-tables... yes
# checking platform... Unix
# checking native dynlink... checking for pkg-config... /usr/local/bin/pkg-config
# checking for GTK+ - version >= 2.0.0... no
# *** Could not run GTK+ test program, checking why...
# *** The test program failed to compile or link. See the file config.log for the
# *** exact error that occured. This usually means GTK+ is incorrectly installed.
### stderr ###
# configure: WARNING: Cannot find camlp4o; please do not modify .ml4 files.
# configure: error: GTK+ is required
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ????
The following actions failed
∗ install lablgtk 2.18.5
No changes have been performed
=-=- lablgtk.2.18.5 troubleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ????
=> This package requires gtk+ 2.0 development packages installed on your system
=> To solve pkg-config issues, you may need to do
'export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig' (macports)
or 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig' (homebrew)
and retry
即使当我输入brew install gtk+
时,我被告知:
Warning: gtk+-2.24.30 already installed
【问题讨论】:
【参考方案1】:我认为您需要安装库libgtk2.0-dev
。
尝试sudo apt-get install libgtk2-dev
用于 debian 基础发行版。
在 Mac OSX 上,有一些事情要做,大部分可以在这里找到:http://www.gtk.org/download/macos.php
【讨论】:
我认为 Mac 无法运行 apt-get?我得到sudo: apt-get: command not found
然后尝试使用 brew 或寻找如何在 mac 上安装它。 ;-)
嗯,来自谷歌搜索“brew install libtk2-dev”我最终到了***.com/questions/20098862/…,我认为这是我已经用brew install gtk+
做的事情
你安装了 XQuartz 吗? Mac 用户需要它来替换 X11。 xquartz.org
你看过这个吗:wiki.gnome.org/Projects/GTK+/OSX/Building#Prerequisites?以上是关于安装 lablgtk 时遇到问题的主要内容,如果未能解决你的问题,请参考以下文章