Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QtSerialPort not building for qt 4.8.5 (Beaglebone Black)
Forum Update on Monday, May 27th 2025

QtSerialPort not building for qt 4.8.5 (Beaglebone Black)

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 4 Posters 2.7k Views
  • 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.
  • C Offline
    C Offline
    cturner
    wrote on last edited by
    #1

    Hi All,

    I am trying to get QtSerialPort to build for the Beaglebone Black. I have Qt 4.8.5 built and have the cross-compiler setup with Qt Creator. I can build, deploy and debug a helloworld app from QtCreator.

    My issue now is that I want to use QtSerialPort in this application. I have followed the steps listed in https://qt-project.org/wiki/QtSerialPort to build within QtCreator, and I get a linking error:

    /home/user/qtprojects/qtserialport/build-qtserialport-BeagleboneBlack-Debug/src/serialport/libQtSerialPort.so: undefined reference to `QSerialPort::dataErrorPolicyChanged(QSerialPort::DataErrorPolicy)'

    A quick find in files shows that dataErrorPolicyChanged is wrapped in a #if QT_DEPRECATED_SINCE(5,2) in the header file. Further searching showed that QT_DEPRECATED_SINCE returns a 1 if the version of Qt is 4.x.

    In qserialport.cpp void QSerialPort::dataErrorPolicyChanged(DataErrorPolicy policy) has been labelled as obsolete, commented out and the body of the function has been deleted.

    So I know what's happening, I'm just not sure how to fix it. Is anyone else using the latest version of the qtserialport source on qt 4.8? Is there any easy workaround for this.

    Thanks!
    ct

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mwoehlke-kitware
      wrote on last edited by
      #2

      FWIW I have the exact same issue on Fedora 20. At a guess, I think moc in Qt 4.8.x doesn't understand the #if and so ignores the code inside of such.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mwoehlke-kitware
        wrote on last edited by
        #3

        Reported as https://bugreports.qt-project.org/browse/QTBUG-41190

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

          Hi and welcome to devnet,

          A fix is on its way, to build it now, remove the deprecation guards around the signal

          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
          • C Offline
            C Offline
            Corpee
            wrote on last edited by
            #5

            I have the same problem with 4.8.2, I'm building on raspberry pi and windows.
            I removed the depreciation guards around the QSerialPort::dataErrorPolicyChanged(DataErrorPolicy policy). I get a new build error in function tst_QSerialPort::twoStageSynchronousLoopback() with indefined reference to bool Qtest::qCompare<int, long>(int const&, long long const&, char const*, char const*, char const*, int)

            File not found:tst_qserialport.cpp

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

              Hi and welcome to devnet,

              A fix is also on its way for that one

              For the moment, if you don't care about the test itself you can simply comment the code from the offending function.

              Otherwise
              replace each

              @QCOMPARE(newlineArray.size(), receiverPort.bytesAvailable());@

              with

              @QCOMPARE(qint64(newlineArray.size()), receiverPort.bytesAvailable());@

              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
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Building from the GIT repository 5.3 branch is now working for Qt 4

                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

                • Login

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