Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. run the program, and always show "error while loading shared libraries:libQt5SerialPort.so".
Forum Updated to NodeBB v4.3 + New Features

run the program, and always show "error while loading shared libraries:libQt5SerialPort.so".

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 3.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Samyang
    wrote on last edited by aha_1980
    #1

    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 to u_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 to ucnv_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 to ucnv_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 to ucal_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 to u_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 to ucal_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 to ucnv_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 to ucal_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 to u_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 to uenum_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 to ucal_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 to ucnv_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 to ucal_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 to ucal_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 to ucnv_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 to ucol_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 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 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.

    Pablo J. RoginaP 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Use a deployment tool like linuxdeployqt.

      Normal static build won't help you as the plugins are still dynamic.

      (Z(:^

      1 Reply Last reply
      3
      • S Samyang

        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 to u_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 to ucnv_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 to ucnv_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 to ucal_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 to u_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 to ucal_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 to ucnv_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 to ucal_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 to u_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 to uenum_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 to ucal_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 to ucnv_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 to ucal_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 to ucal_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 to ucnv_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 to ucol_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 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 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.

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @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

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        2
        • S Offline
          S Offline
          Samyang
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            This should help:

            sudo apt install libavcodec-dev
            

            (Z(:^

            1 Reply Last reply
            3
            • S Offline
              S Offline
              Samyang
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                Maybe just install all Qt dependencies:

                sudo apt build-dep qt5-qmake
                

                (Z(:^

                1 Reply Last reply
                2
                • S Offline
                  S Offline
                  Samyang
                  wrote on last edited by
                  #8

                  thanks for help!

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved