No such file or directory (poppler-qt5)
-
Hi.
I'm using poppler-qt5 in the project. After building the program, I use linuxdeployqt-2-x86_64.AppImage, which creates the lib directory. There are necessary libraries, including libpoppler-qt5.so.1.
But on another computer the terminal has an error message:
error while loading shared libraries: libpoppler.so.67: cannot open shared object file: No such file or directoryldd myApp shows, that not found only libpoppler.so.67
Qt 5.7.1, Ubuntu 14.04 x64
.pro
unix { # poppler-qt5 INCLUDEPATH += /usr/local/include/poppler/qt5 LIBS += -L/usr/local/lib -lpoppler-qt5 -lstdc++ # I tried this #QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN/lib # and this #QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/lib\'' # and this QMAKE_RPATHDIR += $ORIGIN/lib }
But this does not help.
How to add a library without using LD_LIBRARY_PATH? On the destination machine, libpoppler-dev and others are not installed.
-
# I tried this unix { # poppler-qt5 INCLUDEPATH += /usr/local/include/poppler/qt5 #LIBS += -L/usr/local/lib -lpoppler-qt5 -lstdc++ DOLLAR=$ QMAKE_LFLAGS += -Wl,-rpath=$${DOLLAR}$${DOLLAR}ORIGIN/lib LIBS += -lpoppler -lpoppler-qt5 -lstdc++ }
MakeFile:
LFLAGS = -Wl,-rpath=$$ORIGIN/lib -Wl,-O1 -Wl,-rpath,/opt/Qt/Qt5.7.1/5.7/gcc_64/lib# and this unix { # poppler-qt5 INCLUDEPATH += /usr/local/include/poppler/qt5 #LIBS += -L/usr/local/lib -lpoppler-qt5 -lstdc++ QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/lib\'' -L/usr/local/lib LIBS += -lpoppler -lpoppler-qt5 -lstdc++ }
MakeFile:
LFLAGS = -Wl,-rpath,'$$ORIGIN/lib' -L/usr/local/lib -Wl,-O1 -Wl,-rpath,/opt/Qt/Qt5.7.1/5.7/gcc_64/libWhich of these is correct?
-
If I copy libpoppler.so.67 to /usr/lib then the program starts. I do not understand why QMAKE_LFLAGS or QMAKE_RPATHDIR does not work.
-
Hi,
You can try
QMAKE_LFLAGS += -Wl,-rpath,"'\$$ORIGIN'"
-
I decided to use the script with QProcess.
#!/bin/bash
echo <password> | sudo -S cp </path/libpoppler.so.67> /usr/libThanks to all!