简体   繁体   中英

Errors while linking in Qt5 with poppler

/usr/lib/libpoppler.so.50: undefined reference to std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20' Makefile:156: recipe for target 'DocViewer' failed /usr/lib/libsystemd.so.0: undefined reference to lzma_stream_decoder@XZ_5.0' /usr/lib/libQt5Core.so: undefined reference to __cxa_throw_bad_array_new_length@CXXABI_1.3.8' /usr/lib/libsystemd.so.0: undefined reference to lzma_end@XZ_5.0' /usr/lib/libsystemd.so.0: undefined reference to `lzma_code@XZ_5.0' collect2: error: ld returned 1 exit status make: *** [DocViewer] Error 1 20:53:35: The process "/usr/bin/make" exited with code 2.

I get the errors mentioned above while compiling a program using poppler in Qt5 .

Below is my project file, should in change something?

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = DocViewer
TEMPLATE = app

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

SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

For the "__cxa_throw_bad_array_new_length@CXXABI_1.3.8" error in libicu, it looks like the problem is an incompatible icu build (softfp vs hardfp).

I had the same error, which I solved by downloading a rebuilt ICU (to avoid rebuilding it myself).

  • Download the "POT" binaries from http://thebugfreeblog.blogspot.fr/2016/12/binaries-for-pot-550-beta1-on-qt-580.html .
  • lrzuntar the file
  • tar xf qtdeps.tar
  • on the device, move away libicu* (in my case with raspbian it was in usr/lib/arm-linux-gnueabihf), and transfer the libicu* from qtdeps over there
  • on the device, move away the "unicode" include dir (with raspbian it was in /usr/include/arm-linux-gnueabihf/unicode), and copy the unicode include dir from qtdeps over there.
  • re-sync from the device to your sysroot using rsync
  • reconfigure and rebuilt qtbase (after removing the .o files under qtbase/src/corelib that contain "icu" in the name - or rebuild Qt from scratch)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM