bblanchon / pdfium-binaries

📰 Binary distribution of PDFium
789 stars 166 forks source link

/usr/bin/ld: /PDFIUM-Binary/lib/libpdfium.so: error adding symbols: file in wrong format #159

Closed raphael10-collab closed 2 months ago

raphael10-collab commented 2 months ago

With this architecture:

raphy@raohy:~$ dpkg --print-architecture
amd64
raphy@raohy:~$ uname -m
x86_64

I downloaded and extracted this folder : https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-v8-linux-x86.tgz

I specified the path in .bashrc :

export PDFium_DIR="/home/raphy/PDFIUM-Binary"

And in CMakeLists.txt of the project I would like to use the pdfium-binaries I've added:

find_package(PDFium)
target_link_libraries(${PROJECT_NAME} PUBLIC
    pdfium
)

Rebuilding the project I get this error message:

raphy@raohy:~/wx-webview$ cmake --build builddir
-- Found PDFium: /home/raphy/PDFIUM-Binary/lib/libpdfium.so (found version "123.0.6309.0")
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/wx-webview/builddir
[ 25%] Building CXX object CMakeFiles/WebView.dir/webview.cpp.o
[ 50%] Building CXX object CMakeFiles/WebView.dir/infopiece.cpp.o
[ 75%] Building CXX object CMakeFiles/WebView.dir/textFromImage.cpp.o
[100%] Linking CXX executable WebView
/usr/bin/ld: /home/raphy/PDFIUM-Binary/lib/libpdfium.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/WebView.dir/build.make:132: WebView] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/WebView.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

O.S. : Ubuntu 23.10

How to make it work?

bblanchon commented 2 months ago

Hi @raphael10-collab,

Your architecture is x64, but you downloaded the x86 tarball.

As far as we are concerned, x64, x86_64, and amd64 are synonyms. I use x64 because it's the name used in Chromium.

Best regards, Benoit

raphael10-collab commented 2 months ago

Thank you @bblanchon I downloaded pdfium-v8-linux-x64.tgz and the error disappeared