1
votes

The goal is to show pdf's on my target => imx6 board + display. My host's OS is Linux. So far i'm having a program written in Qt 5. It compiles fine and i'm able to see it on the display.

To show some pdfs i would like to use the poppler library. The problem is that i'm not able to get this done. Properly ...

My steps so far: I did the basic installation of poppler like it is described in the INSTALL file.

mkdir build

cd build

cmake ..

make

make install

then added

INCLUDEPATH += /home/user/poppler/include/poppler/qt5 LIBS += -L"/home/user/poppler/lib" -lpoppler-qt5

to my .pro file

and the #include <poppler-qt5.h> to my .cpp file.

And the result when running is this:

/home/user/poppler/lib/libpoppler-qt5.so:-1: error: file not recognized: File format not recognized

:-1: error: collect2: error: ld returned 1 exit status

Now i have just two ideas. First one is to cross-compile the poppler source code. (I tried this with a toolchain file but failed :'D) Second idea is to put the library into Qt together with my project and compile it there - maybe that could work. I just don't know how. Help.

I'm also open for something else then poppler - i just want to show pdf's.

1

1 Answers

0
votes

The problem, here, is you are somehow compiling Qt projects for ARM, using the corresponding toolchain and sysroot and ABI, and you can not just link to libraries you compiled for, say, x86_64, because they're just binary incompatible.

In the very lucky case you managed to configure creator for cross compilation, just make a creator project for the poppler library, using cmake, and configure the project with the same kit you use for the imx6 applications. Once you have it built for ARM, you can proper link it in your app, providing the full path to LIBS in the .pro file.

In case you're using Yocto, instead, just make a recipe for poppler. In case you're not, maybe you should.