我正在尝试以与 brew 相同的方式构建 wireshark:
13:48 marko@marko-mpbr:/tmp $ brew fetch wireshark
==> Downloading http://www.wireshark.org/download/src/wireshark-1.8.6.tar.bz2
Already downloaded: /Library/Caches/Homebrew/wireshark-1.8.6.tar.bz2
SHA1: 0f51ed901b5e07cceb1373f3368f739be8f1e827
SHA256: 2722ed3e926c26648faec31a81b7881d829df85762c21794b9dd9e4f227331ea
13:49 marko@marko-mpbr:/tmp $ tar xf /Library/Caches/Homebrew/wireshark-1.8.6.tar.bz2
13:49 marko@marko-mpbr:/tmp $ cd wireshark-1.8.6/
13:49 marko@marko-mpbr:/tmp/wireshark-1.8.6 $ ./configure --prefix=/usr/local/Cellar/wireshark/1.8.6-marko
[skip]
checking for GTK+ - version >= 2.12.0 and < 3.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.
configure: error: Neither Qt nor GTK+ 2.12 or later are available, so Wireshark can't be compiled
brew 有什么不同?为什么在 brew 中构建成功,但在我执行时却不行?所有配置参数都相同。也许是环境中的问题?
答案1
您必须将其包含/opt/X11/lib/pkgconfig
在 PKG_CONFIG_PATH 中:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATH
执行之前configure
答案2
我通过运行 解决了该问题--with-x
,即brew install wireshark --with-x
。根据公式 ( /usr/local/Library/Formula/wireshark.rb
),可用的选项是--with-x
和--with-qt
。