Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved wrong library or version mismatch when opening QSerialPort

    General and Desktop
    serialport debug libraries qt5.7
    3
    11
    2776
    Loading More Posts
    • 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.
    • douglas
      douglas last edited by aha_1980

      Hi,
      I am developing a GUI application in QT5 on Ubuntu host PC for an embedded device running Yocto, and I succesfully added the QSerialPort module to my project.
      In my mainwindow.cpp, at the startup, I'm trying to call a routine which initialize the serial port in this way:

      mainwindow.h:

      public:
      QSerialPort *serialport;
      

      mainwindow.cpp:

      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent),
          ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      ...
          serialport->setPortName("/dev/ttymxc2");
          serialport->setBaudRate(QSerialPort::Baud9600);
          serialport->setDataBits(QSerialPort::Data8);
          serialport->setParity(QSerialPort::NoParity);
          serialport->setStopBits(QSerialPort::OneStop);
          serialport->setFlowControl(QSerialPort::NoFlowControl);
          if (serialport->open(QIODevice::ReadWrite))
          {
                // OK
          }
      }
      

      The problem is that when the serialport init section is present and uncommented, the application does not start at all, and the "application Output" window in Qt Creator shows the following:

      Debugging starts
      Listening on port 10000
      Remote debugging from host 192.168.25.167
      Process /home/root/FiocchettiDemo created; pid = 830
      QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
      libEGL warning: DRI2: failed to authenticate
      libpng warning: iCCP: known incorrect sRGB profile
      libpng warning: iCCP: known incorrect sRGB profile
      libpng warning: iCCP: known incorrect sRGB profile
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5PrintSupport.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5Widgets.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5Gui.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5SerialPort.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5Core.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libm.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libc.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libGLESv2.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libpng16.so.16" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libz.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libdl.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libglib-2.0.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/ld-linux-armhf.so.3" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libdrm.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libglapi.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libresolv.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libcap.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libpcre.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/qt5/plugins/platforms/libqxcb.so" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5XcbQpa.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libQt5DBus.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libfontconfig.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libfreetype.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libX11-xcb.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libX11.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXi.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-xkb.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-render-util.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-render.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-sync.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-xfixes.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-xinerama.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-randr.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-image.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-shm.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-keysyms.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-icccm.so.4" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-shape.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxkbcommon-x11.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxkbcommon.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libdbus-1.so.3" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libexpat.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXext.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXau.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXdmcp.so.6" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-util.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libsystemd.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/liblzma.so.5" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libnss_compat.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libnsl.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libnss_nis.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/lib/libnss_files.so.2" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXcursor.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXrender.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libXfixes.so.3" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libEGL.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-dri2.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-dri3.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libxcb-present.so.0" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libgbm.so.1" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/dri/swrast_dri.so" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/qt5/plugins/imageformats/libqjpeg.so" is not at the expected address (wrong library or version mismatch?)
      .dynamic section for "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libjpeg.so.62" is not at the expected address (wrong library or version mismatch?)
      Could not load shared library symbols for /usr/lib/libxshmfence.so.1.
      Do you need "set solib-search-path" or "set sysroot"?File "/opt/fslc-x11/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/usr/lib/libstdc++.so.6.0.22-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
      

      I'm not sure it's this related to the serialport initialization.. Anyone has any idea how to fix it?
      Many thanks!

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @douglas last edited by

        @douglas How did you add serial port module? How did you install it? Is it same version as other Qt modules?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        douglas 1 Reply Last reply Reply Quote 2
        • douglas
          douglas @jsulm last edited by

          @jsulm
          I did not specify this (if it can be useful): I am cross-compiling for my device.
          Browsing the target device, I can see the following libraries under /usr/lib:
          0_1530180291904_70403f52-7625-4f5b-b329-04764724a00f-immagine.png
          so I suppose the serialport module version is the 5.9, right?
          In my kit, the Qt version displayed is 5.7.1, so it seems to be different from the serialport module. Can this be the problem?

          To include the serialport module in my project, I added "QT += serialport" to my .pro file.

          Am I missing something?
          Thank you.

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @douglas last edited by

            @douglas One moment. When you get that error - do you build/execute for your host machine or target device? Is your app going to run on a PC or on the target device?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            douglas 1 Reply Last reply Reply Quote 0
            • douglas
              douglas @jsulm last edited by

              @jsulm My application should run onto the target device (i.MX 6UL processor), not on the Ubuntu PC.
              That error came out when I try either to run the application directly from my target device and from the QtCreator Debugger.
              The GUI doesn't appear on the device display, and the Application output console shows that error.

              jsulm 1 Reply Last reply Reply Quote 0
              • jsulm
                jsulm Lifetime Qt Champion @douglas last edited by

                @douglas Can you try this on your device:

                ldd YOUR_EXE_FILE
                

                and put the output here?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                douglas 1 Reply Last reply Reply Quote 0
                • douglas
                  douglas @jsulm last edited by

                  @jsulm is it possible that commands gives me:

                  sh: ldd: command not found
                  

                  ?
                  My executable file has not .exe estension.

                  jsulm 1 Reply Last reply Reply Quote 0
                  • jsulm
                    jsulm Lifetime Qt Champion @douglas last edited by

                    @douglas I didn't say it has .exe extension. YOUR_EXE_FILE is simply a placeholder for the name of your executable file as I don't know it.
                    Another question: do you use same Qt version to build your app and to execute it on your target? On your target you have Qt 5.9.2 but you said on your PC you have 5.7.1 right? If it is the case you need to make sure you use exactly the same Qt version.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    douglas 1 Reply Last reply Reply Quote 2
                    • douglas
                      douglas @jsulm last edited by

                      @jsulm said in wrong library or version mismatch whel opening QSerialPort:

                      Another question: do you use same Qt version to build your app and to execute it on your target? On your target you have Qt 5.9.2 but you said on your PC you have 5.7.1 right?

                      Yes, it seems to be right. How can I align the libraries version?
                      Thank you!

                      aha_1980 jsulm 2 Replies Last reply Reply Quote 0
                      • aha_1980
                        aha_1980 Lifetime Qt Champion @douglas last edited by

                        @douglas you need to copy all new libraries and their dependencies to your target, overwriting the existing ones

                        Qt has to stay free or it will die.

                        1 Reply Last reply Reply Quote 0
                        • jsulm
                          jsulm Lifetime Qt Champion @douglas last edited by jsulm

                          @douglas Take a look at http://doc.qt.io/qt-5/linux-deployment.html
                          And the question is: which version do you actually want to use?

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post