How to link against Poppler library?

  • I installed poppler and the lib files are all there but once i use it on my application i get this error:
    ->cannot find -lpoppler-qt5

    i added this in my .pro file:

    INCLUDEPATH += /usr/include/poppler/qt5
    LIBS += -L/usr/lib/ -lpoppler-qt5

    any idea?

  • Qt Champions 2018

    @michaelL Is file in /usr/lib ?

  • yes it is

  • @jsulm the is located at /usr/lib/x86_64-linux-gnu
    should i copy it to /usr/lib?

  • So this is working for me, maybe a stupid question. but did you rerun qmake and rebuild all?
    If yes, can you post your compiler output for further investigation.

  • @sneubert well i copy the to /usr/lib/ and i got this issues:
    /usr/lib// file not recognized: File format not recognized
    collect2: error: ld returned 1 exit status
    Makefile:315: recipe for target 'vasoport' failed
    make: *** [vasoport] Error 1
    15:53:36: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project vasoport (kit: Qt 5.5.1 i.MX6)
    When executing step "Make"

  • @sneubert i remove the copied file and i get this error message after qmake->rebuild:
    lQt5SerialPort -lQt5Core -lGLESv2 -lEGL -lGAL -lpthread
    /usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lpoppler-qt5
    Makefile:315: recipe for target 'vasoport' failed
    collect2: error: ld returned 1 exit status
    make: *** [vasoport] Error 1
    15:56:14: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project vasoport (kit: Qt 5.5.1 i.MX6)
    When executing step "Make"

  • Ok, now i see your are building for an embedded target (i.MX6). Your poppler lib is from your host and sure for X86, you need ARM.
    You need to get a poppler lib build matching your target, or compile poppler yourself.

  • @sneubert thank you!
    My ARM is also CPU is also running on debian. Where can i get poppler for ARM?
    I found this

  • Your target is running debian, just try to download the package with something like
    sudo apt-get install libpoppler-qt5-dev on your target.
    This should install the libraries on your target.
    Do you use a copy of your remote target for sysroot, or nfs to access the target libs?
    If you have a copy, just copy libpoppler-qt5 from your target to your host sysroot.

  • @sneubert thank again! I have a copy. I install and copy the file from imx6 to 0x86.
    Now i get 379 undefined reference:
    /usr/lib/arm-linux-gnueabihf// undefined reference to gfree' /usr/lib/arm-linux-gnueabihf// undefined reference toPageTransition::~PageTransition()'
    /usr/lib/arm-linux-gnueabihf// undefined reference to Dict::lookup(char const*, Object*, int)' /usr/lib/arm-linux-gnueabihf// undefined reference toGfxFont::locateFont(XRef*, bool)'
    /usr/lib/arm-linux-gnueabihf// undefined reference to QDomNode::~QDomNode()' /usr/lib/arm-linux-gnueabihf// undefined reference toQDomNode::nextSibling() const'
    /usr/lib/arm-linux-gnueabihf// undefined reference to PDFDoc::processLinks(OutputDev*, int)' /usr/lib/arm-linux-gnueabihf// undefined reference toOutputDev::setDefaultCTM(double*)'
    /usr/lib/arm-linux-gnueabihf// undefined reference to `AnnotCaret::AnnotCaret(PDFDoc*, PDFRectangle*)'
    collect2: error: ld returned 1 exit status
    make: *** [vasoport] Error 1
    16:50:48: The process "/usr/bin/make" exited with code 2.

    Should i copy something else from ARM to the host pcb?

  • Sorry, of course you also need all the other dependencies, not just libpoppler-qt5.
    I alway rsync the remote library and include directories to my host sysroot, rather than copy file by file, but you can always use ldd to display dependencies.
    For example poppler on rpi yields:

    pi@raspberrypi:/usr/lib/arm-linux-gnueabihf $ ldd
            /usr/lib/arm-linux-gnueabihf/ (0x76eb1000)
   => /usr/lib/arm-linux-gnueabihf/ (0x76c9f000)
   => /usr/local/qt5pi/lib/ (0x76c6f000)
   => /usr/local/qt5pi/lib/ (0x7674c000)
   => /usr/local/qt5pi/lib/ (0x762dd000)
   => /usr/local/qt5pi/lib/ (0x75dc8000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75ceb000)
   => /lib/arm-linux-gnueabihf/ (0x75baa000)
            /lib/ (0x54b19000)
   => /lib/arm-linux-gnueabihf/ (0x75b7d000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75b31000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75ab9000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75a63000)
   => /lib/arm-linux-gnueabihf/ (0x75a33000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75a04000)
   => /usr/lib/arm-linux-gnueabihf/ (0x759c2000)
   => /usr/lib/arm-linux-gnueabihf/ (0x7592a000)
   => /lib/arm-linux-gnueabihf/ (0x75901000)
   => /lib/arm-linux-gnueabihf/ (0x75886000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75861000)
   => /lib/arm-linux-gnueabihf/ (0x7583a000)
   => /lib/arm-linux-gnueabihf/ (0x75826000)
   => /usr/lib/arm-linux-gnueabihf/ (0x75814000)
   => /lib/arm-linux-gnueabihf/ (0x75711000)
   => /lib/arm-linux-gnueabihf/ (0x756fa000)
   => /lib/arm-linux-gnueabihf/ (0x756d3000)
   => /usr/lib/arm-linux-gnueabihf/ (0x756b6000)
   => /lib/arm-linux-gnueabihf/ (0x75683000)
   => /opt/vc/lib/ (0x7564a000)
   => /opt/vc/lib/ (0x75624000)
   => /opt/vc/lib/ (0x7560e000)
   => /opt/vc/lib/ (0x755f4000)
   => /lib/arm-linux-gnueabihf/ (0x75580000)

  • @sneubert I did "apt-get install libpoppler-qt5-dev" on the iMx6 and i after that the iMx6 give me if i start my Qt Application:
    symbol lookup error: /usr/local/qt5.5.1/plugins/egldeviceintegrations/ undefined symbol: fbGetDisplayByIndex
    Application finished with exit code 127.

  • I just made a short google search onfbGetDisplayByIndex and it seems to be a quit common issue. In the search result there are many points to start.
    Do other application without poppler, but with qt run on your iMx6?

  • @sneubert just saw the license from poppler and i want to use a PDF viewer with LGPLV3 like QtLabs PDF module instead, so i think i will go on from there but thanks for your help

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.