我正在尝试安装 R 包“pdftools”并遇到以下情况:
In file included from libqpdf/Pl_DCT.cc:1:
include/qpdf/Pl_DCT.hh:27:10: fatal error: 'jpeglib.h' file not found
#include <jpeglib.h>
^
1 error generated.
make: *** [libqpdf/Pl_DCT.o] Error 1
ERROR: compilation failed for package ‘qpdf’
我在装有 OS X 10.10.5 的 Mac 上使用 R 版本 3.3.3,由于多种原因,目前无法更新我的操作系统。
我验证下载的源包在:/private/var/folders/t3/_mlp_5z15z9_628n5q00pw_s8d_kfs/T/RtmpnJERsz/downloaded_packages
我看到了以下帖子: 找不到'jpeglib.h'文件
然后跑了
$ find /usr/local -name \*jpeg\* -print -name \*jpg\* -print
/usr/local/Cellar/boost/1.71.0/include/boost/gil/extension/io/jpeg
/usr/local/Cellar/boost/1.71.0/include/boost/gil/extension/io/jpeg.hpp
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/libjpeg
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/libjpeg-turbo
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg-archive.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg-turbo.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeginfo.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpegoptim.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpegrescan.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mjpegtools.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mozjpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openjpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/recoverjpeg.rb
find: /usr/local/jamf: Permission denied
文件“jpeglib.h”似乎没有列出,但我将它定位在:/anaconda3/pkgs/jpeg-9b-he5867d9_2/include/jpeglib.h
- 根据其他帖子,我从终端尝试过:
$ brew install boost. (Lot of installing, no errors)
$ brew doctor (Lot of installing, no errors)
$ xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ brew install cairo gobject-introspection pixman (Lot of installing, no errors)
然后重新启动并尝试再次安装 pdftools,结果相同。
- 也看到了这篇文章,但完全超出了我的想象: https ://www.cocoanetics.com/2012/01/helping-xcode-find-library-headers/
任何简单步骤的解决方案都值得赞赏。