Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    QtSerialPort not building for qt 4.8.5 (Beaglebone Black)

    Mobile and Embedded
    4
    7
    2280
    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.
    • C
      cturner last edited by

      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 Reply Quote 0
      • M
        mwoehlke-kitware last edited by

        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 Reply Quote 0
        • M
          mwoehlke-kitware last edited by

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

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • C
              Corpee last edited by

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  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 Reply Quote 0
                  • First post
                    Last post