ajrcarey / pdfium-render

A high-level idiomatic Rust wrapper around Pdfium, the C++ PDF library used by the Google Chromium project.
https://crates.io/crates/pdfium-render
Other
359 stars 59 forks source link

Dynamic linking using the Static feature #170

Open JesusFileto opened 6 days ago

JesusFileto commented 6 days ago

As mention in this, there seem to be issues with dynamic linking of the runtime package of Pdfium. When setting the environment variable PDFIUM_DYMANIC_LIB_PATH in cargo build, there is successful compilation and linking to the correct .dylib path.

However, when actually running the program there is a runtime failure giving the error code Library not loaded: ./libpdfium.dylib Referenced from: <A8541E05-7708-3717-81E9-16F53087F310> /Users/jfileto/Library/CloudStorage/OneDrive-YaleUniversity/Chonky+HASH/hash/target/debug/deps/chonky-21945ee0038f5ee1 Reason: tried: './libpdfium.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS./libpdfium.dylib' (no such file), './libpdfium.dylib' (no such file)

ajrcarey commented 3 days ago

Hi @JesusFileto , thank you for reporting the issue. Please walk me through the exact steps required to reproduce the problem (this is on macOS, yes?). Regarding the error message you supplied:

Reason: tried: './libpdfium.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS./libpdfium.dylib' (no such file), './libpdfium.dylib' (no such file)

Can you confirm there is a suitable libpdfium.dylib at one of those locations? You must provide this yourself, pdfium-render will not download it or build it for you.