Solved run the program, and always show "error while loading shared libraries:libQt5SerialPort.so".
-
I learn qt5.10.1 and write a program which use QTSerialPort, it work well.but I want to run this program on other ubuntu laotop, it always show "error while loading shared libraries:libQt5SerialPort.so".
make
g++ -Wl,-O1 -Wl,-rpath,/opt/Qt5.11.1/5.11.1/gcc_64/lib -o COMTool main.o mainwindow.o moc_mainwindow.o -L/opt/Qt5.11.1/5.11.1/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5SerialPort -lQt5Core -lGL -lpthreadif i edit the pro file and add "CONFIG+=static", and then make:
g++ -Wl,-O1 -o COMTool main.o mainwindow.o moc_mainwindow.o -L/opt/Qt5.11.1/5.11.1/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5SerialPort -lQt5Core -lGL -lpthread
/usr/bin/ld: warning: libicui18n.so.56, needed by /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicuuc.so.56, needed by /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicudata.so.56, needed by /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucol_open_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
u_strToLower_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_getStandardName_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucnv_compareNames_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_clone_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucnv_getAlias_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference touenum_next_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucal_open_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucol_setAttribute_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
u_strToUpper_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_setSubstChars_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucal_getTimeZoneDisplayName_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_openCountryTimeZones_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucnv_fromUnicode_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_open_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucal_openTimeZones_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_countAliases_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
u_errorName_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_inDaylightTime_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
uenum_close_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_getAvailableName_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucal_close_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_openTimeZoneIDEnumeration_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucnv_getDefaultName_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_getDSTSavings_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucal_getDefaultTimeZone_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_toUnicode_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucal_setMillis_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucol_strcoll_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucnv_close_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucol_close_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucol_getSortKey_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_countAvailable_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to
ucnv_getMaxCharSize_56'
/opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_get_56'
collect2: error: ld returned 1 exit statusi check the path /opt/Qt5.11.1/5.11.1/gcc_64/lib, and can find these three files:libicuuc.so.56,libicui18n.so.56,libicudata.so.5.
so I am confused, need help.
-
Use a deployment tool like linuxdeployqt.
Normal static build won't help you as the plugins are still dynamic.
-
@Samyang said in run the progrm, and always show "error while loading shared libraries:libQt5SerialPort.so".:
run this program on other ubuntu laotop, it always show "error while loading shared libraries:libQt5SerialPort.so".
Yes, as @sierdzio mentioned, you may want to be sure to deploy the required libraries into the other PC
-
Hi, Sierdzio and Rogina
Thanks for your comment, and I download the linuxdeployqt tool, but i find a lot of lib miss error. I try to install some software,but the followed error still happen:
abuser@ubuntu:/usr/local/release$ linuxdeployqt ./COMTool -appimage
linuxdeployqt 4 (commit 8b3ded6), build 571 built on 2018-10-07 20:58:12 UTC
FHS-like mode with PREFIX, fhsPrefix: "/usr/local"
app-binary: "/usr/local/release/COMTool"
appDirPath: "/usr"
relativeBinPath: "local/bin/COMTool"
ERROR: ldd outputLine: "libavcodec.so.53 => not found"
ERROR: for binary: "/usr/local/java/jre1.8.0_101/lib/amd64/libavplugin-53.so"
ERROR: Please ensure that all libraries can be found by ldd. Aborting.I do not know how to solve this libavcodec.so.53 missing.
-
This should help:
sudo apt install libavcodec-dev
-
Thanks Sierdzio for help.
but new error happened:
labuser@ubuntu:/usr/local/release$ linuxdeployqt ./hello -appimage
linuxdeployqt: error while loading shared libraries: libicui18n.so.56: cannot open shared object file: No such file or directory -
Maybe just install all Qt dependencies:
sudo apt build-dep qt5-qmake
-
thanks for help!