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 -lpthread

    if 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 to ucol_open_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference tou_strToLower_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_getStandardName_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_compareNames_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucal_clone_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_getAlias_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to uenum_next_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_open_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucol_setAttribute_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference tou_strToUpper_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_setSubstChars_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_getTimeZoneDisplayName_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucal_openCountryTimeZones_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_fromUnicode_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_open_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_openTimeZones_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_countAliases_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference tou_errorName_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucal_inDaylightTime_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference touenum_close_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_getAvailableName_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_close_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucal_openTimeZoneIDEnumeration_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_getDefaultName_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucal_getDSTSavings_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_getDefaultTimeZone_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_toUnicode_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucal_setMillis_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucol_strcoll_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_close_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucol_close_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucol_getSortKey_56'
    /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference to ucnv_countAvailable_56' /opt/Qt5.11.1/5.11.1/gcc_64/lib/libQt5Core.so: undefined reference toucnv_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 status

    i 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.


  • Moderators

    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.


  • Moderators

    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


  • Moderators

    Maybe just install all Qt dependencies:

    sudo apt build-dep qt5-qmake
    


  • thanks for help!


Log in to reply
 

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