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. Can't access QtSerialPort, other includes

Can't access QtSerialPort, other includes

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 2 Posters 4.1k 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.
  • P Offline
    P Offline
    PaulAlberti
    wrote on last edited by
    #1

    I have recently installed Qt5.4 on Opensuse 12.3, where I have had
    Qt 4.8 for a while - However, when I try to compile a program that does a lot
    of serial communications and runs well under 4.8,
    (and having taken LIB -lQtSerialPort out of the project file
    and put in QT += serialport)

    I get "No such file or directory" at the line
    #include <QtSerialPort/QtSerialPort>

    I have tried putting into the project file
    INCLUDEPATH += </opt/Qt5.4.0/5.4/gcc_64>
    and variants such as INCLUDEPATH += </opt/Qt5.4.0/5.4/gcc_64/include>

    but this does not help. When I put the whole path in
    #include </opt/Qt5.4.0/5.4/gcc_64/include/QtSerialPort/QtSerialPortDepends>
    etc.

    I get
    "Q_NULLPTR was not declared in this scope"

    at line 182 of qserialport.h

    explicit QSerialPort(QObject *parent = Q_NULLPTR);

    This runs fine on a machine that I have installed Opensuse13.1 on, where the installation
    was done by Opensuse 13.1.

    Thanks for any hints !!

    Paul

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

      Hi and welcome to devnet,

      Are you sure you are using the correct qmake ? Kit ? Qt version ?

      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
      • P Offline
        P Offline
        PaulAlberti
        wrote on last edited by
        #3

        Thanks for the reply -

        The Kit and Qt version I checked in the project settings a few times.
        I also uninstalled and re-installed, and tried a different directory
        (/usr/Qt). I installed from an live "installer" and then tried downloading
        the 600ish MByte static installer. These are generic linux,
        I wonder if they're ok with Qt 12.3, or if somehow the include
        directory is mixed up because Qt4.8 is still there.

        I didn't check the qmake - how would I do that?

        Thanks

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

          Did you also update your project to use the new Kit ?

          If you are using Qt Creator to build your project, the qmake version should be set correctly. It must be the one located in your Qt installation.

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

            Thanks for your reply.

            I'm not sure what you mean by "update your project". I opened the project in the (new version of) Qt Creator, and under "Tools -> Options -> Build and Run set Kits and Qt versions. Is there something else that should have been done?

            1 Reply Last reply
            0
            • P Offline
              P Offline
              PaulAlberti
              wrote on last edited by
              #6

              Could it be the version of g++? It's 4.7 . .

              1 Reply Last reply
              0
              • P Offline
                P Offline
                PaulAlberti
                wrote on last edited by
                #7

                If I start a new project, and try to
                #include <QtSerialPort/QtSerialPort. it works!

                DO you think that's the best solution?

                Thanks

                Paul

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

                  At some point, it might be simpler to indeed recreate the project from scratch.

                  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
                  • P Offline
                    P Offline
                    PaulAlberti
                    wrote on last edited by
                    #9

                    Thanks - actually, I tracked it down via qmake to the .pro.user file, which still had the Qt4 information - after deleting it, the system re-created it, and now it compiles - with some annoying complaints (won't take TRUE, insists on true)

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

                      You're welcome !

                      Good !

                      What generates these complaints ?

                      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
                      • P Offline
                        P Offline
                        PaulAlberti
                        wrote on last edited by
                        #11

                        My simple program compiles, but the larger program
                        says "QPrinter has not been declared" in file included from /usr/include/QPlainTextEdit", despite my having added
                        Qt += printsupport and chanaged the header calls in my code
                        as suggested to
                        #include <QtPrintSupport/QPrinter>,
                        and also
                        ‘QT_STATIC_CONST’ does not name a type, which I gather
                        is an incompatibility between qwt and Qt5.4

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

                          "/usr/include/QPlaintTextEdit" ?

                          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