Skip to content

pkg-config also required for install on macOS #128

@cjyetman

Description

@cjyetman

While trying to install {pdftools} on macOS (ARM64), I ran into problems, even after manually installing poppler with brew install poppler. I was getting the following error message

--------------------------- [ANTICONF] --------------------------------
Configuration failed to find 'poppler-cpp' system library. Try installing:
 * rpm: poppler-cpp-devel (Fedora, CentOS, RHEL)
 * brew: poppler (MacOS)
 * deb: libpoppler-cpp-dev (Debian, Ubuntu, etc)
 * On Ubuntu 16.04 or 18.04 use this PPA:
    sudo add-apt-repository -y ppa:cran/poppler
    sudo apt-get update
    sudo apt-get install -y libpoppler-cpp-dev
If poppler-cpp is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a poppler-cpp.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: 'poppler-document.h' file not found
#include <poppler-document.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
--------------------------------------------------------------------

which seems to assume one already has pkg-config installed but not correctly configured, but I did not have pkg-config installed (nor know what it is frankly). Ultimately, this was easily resolved by running brew install pkg-config poppler.

Maybe this is all obvious to some, but it wasn't to me and took quite some time to figure out and I did not find this suggested anywhere on the www, so maybe this could be useful to document somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions