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. Serialport: Error while loading shared libraries: libQtSerialPort.so.1:

Serialport: Error while loading shared libraries: libQtSerialPort.so.1:

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 4 Posters 9.9k Views 1 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.
  • R Offline
    R Offline
    Ramon
    wrote on last edited by
    #1

    Hi,

    I want to install 'serialport' library on QT 4.8.4 (GCC 4.6.1, 32 bit). I'm cross-compiling the applications on laptop for deployment on Beaglebone Black.
    I followed the steps mentioned here:
    @Recommended steps to build the QtSerialPort library for Qt4/Qt5 from QtCreator:

    download and unpack the QtSerialPort sources
    run QtCreator and open the “qtserialport.pro” project file
    get to “Projects->(Your Kit)->Build->Build Steps”
    add a new make “Build Step” and write to the “Make arguments” the install target
    from the menus, select “Rebuild Project qtserialport”@
    

    Since I had admin privilege issues, I ran the steps by logging into Linux as root and it got 'rebuilt' successfully. I thought it got installed properly.

    The problem:
    I created a new project 'QSerial2' and added
    CONFIG += serialport and the install target in the .pro file:
    @QT += core gui
    CONFIG += serialport
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = QSerial2
    target.files = QSerial2
    target.path = /home/root

    INSTALLS += target
    

    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui@

    Then I opened main.cpp and pasted the same simple example code given here: https://qt-project.org/wiki/QtSerialPort#d065aef6724572158f14e550906f5913

    But it gives the error
    @
    "/home/root/QSerial2: error while loading shared libraries: libQtSerialPort.so.1: cannot open shared object file: No such file or directory
    Remote application finished with exit code 127."@

    Please help.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      Are you sure that library is installed? Check all *.so, *.prf and header files in your Qt place.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Is libQtSerialPort stored somewhere unusual ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Ramon
          wrote on last edited by
          #4

          Hi,
          I searched for libQtSerialPort.so in Linux directories and found the following in /opt/qt/lib:

          libQtSerialPort.prl
          libQtSerialPort.so
          libQtSerialPort.so.1
          libQtSerialPort.so.1.0
          libQtSerialPort.so.1.0.0

          I wish to point out that I couldn't find any files named libQtSerialPortInfo.
          I set the path /opt/qt/lib permanently by running the following in terminal
          @PATH=$PATH:/opt/qt/lib
          export PATH@

          Then opened QTCreator, created a new project and did the same things as given in first post. In addition, in Projects > Build & Run > Build > Build Environment > Path, I added /opt/qt/lib. So now it looks @/opt/qt/bin:/usr/local/angstrom/arm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/qt/lib @
          I copy pasted the same code mentioned in first post and the error is the same.

          Am I doing something wrong?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kuzulis
            Qt Champions 2020
            wrote on last edited by
            #5

            bq. Am I doing something wrong?

            Yes.

            1. You should build the QtSerialPort from user account
            2. You should just do: "sudo make install" from shadow directory to install of QtSerialPort
            3. You should to check for all *.so, *.prf, *.h files in your system
            4. You should not setup the env.

            Please, just re-read WIKI again and try to do search solution in this forum (because this question arise again and again, and I was tired to response again and again to same questions).

            PS: I don't understand, what is unclear in WIKI?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Wouldn't you be mixing your x86 Qt with your cross-compiled Qt by any chances ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Ramon
                wrote on last edited by
                #7

                Hi kuzulis and SGaist,
                Thank you for the reply.

                I ran the steps again, this time by installing 'git' and ran
                @git clone git://gitorious.org/qt/qtserialport.git@
                Repeated the steps mentioned in the first post of this thread and the error went away.
                This is the output I see on QT console:
                @Name : "ttyGS0"
                Description : ""
                Manufacturer: ""
                User requested stop. Shutting down...
                sh: line 1: 378 Terminated DISPLAY=:0.0 /home/root/QTSerial5
                Remote application finished with exit code 143.@

                I shutdown Beaglebone Black (BBB) and ran the project and as expected, QT said: @Connecting to device...
                SSH connection failed: Timeout waiting for reply from server.@

                My queries:

                1. Have I installed serialport properly?
                2. It showed serialport number as 'ttyGS0'. But on BBB, port names are ttyO0, ttyO1, ttyO2 etc. ttyO0 is enabed by default and I manually enabled ttyO4 and ran the QT code, but QT mentions only ttyGS0. Why is it so?

                For your information, this is what I see in Projects > Run > Files to deploy field:
                @/root/build-qtserialport-BBB-Debug/QTSerial5/QTSerial5 - /home/root
                /root/qtserialport/src/serialport/qserialportglobal.h- /opt/qt/include/QtSerialPort
                /root/qtserialport/src/serialport/qserialport.h- /opt/qt/include/QtSerialPort
                /root/qtserialport/src/serialport/qserialportinfo.h- /opt/qt/include/QtSerialPort
                /root/qtserialport/src/serialport/at4support/serialport.prf- /opt/qt/mkspecs/features
                /root/build-qtserialport-BBB-Debug/src/serialport/libQtSerialPort.so- /opt/qt/lib
                /root/build-qtserialport-BBB-Debug/src/serialport/libQtSerialPort.so.1.0.0- /opt/qt/lib
                /root/build-qtserialport-BBB-Debug/src/serialport/libQtSerialPort.so.1.0- /opt/qt/lib
                /root/build-qtserialport-BBB-Debug/src/serialport/libQtSerialPort.so.1- /opt/qt/lib@

                [quote author="SGaist" date="1405543230"]Wouldn't you be mixing your x86 Qt with your cross-compiled Qt by any chances ?[/quote]
                I think so. But as a newbie to these things, I can't say anything with confidence. Please guide me.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  The name of the serial port can change between two devices, two computers etc.

                  How does your target Qt installation look like ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Ramon
                    wrote on last edited by
                    #9

                    Hi,
                    Sorry for the late reply.

                    On host laptop I did the "following":http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/:

                    1. Installed Angstrom cross-compile toolchain (i686)
                    2. Installed qt-everywhere-opensource-src-4.8.5.tar.gz
                    3. Configured, built and installed 'QT Embedded'

                    On target Beaglebone Black (running Angstrom Linux):

                    1. Installed QT SDK by copying '/opt/qt/lib' on host to '/opt/qt/'

                    Then installed QT Creator 2.8.0 (x86)on host, configured QT version, kit etc and developed & deployed the remote application.

                    After doing all this, the touchscreen on the target board was not working. So I installed 'qt4-embedded' on target and now it works. Please tell if you need more information.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      manolia
                      wrote on last edited by
                      #10

                      [quote author="Ramon" date="1407179520"]Please let me know if you can get the serial port (UART) working.

                      After installation I ran the sample code given on QTSerialPort wiki, but it detected only the USB port. Any idea why the serialport (ttyO0) doesn't get detected? http://qt-project.org/forums/viewthread/44916/#185469

                      [/quote]
                      Yeah. I work with rfid reader through usb, but i can only see COM ports. Maybe CreateFile for a com port, read from ttyO0 and write on the new file? if QSerialPort is essential. If not you can stick to reading from the UART file.
                      I might be wrong. I just started to use C++ and Qt.

                      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