Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Lot of errors but it builds and runs successfully
Forum Updated to NodeBB v4.3 + New Features

Lot of errors but it builds and runs successfully

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 4 Posters 3.9k Views 3 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    I cross-compiled Qt5.13 for ARM A7 and then I downloaded QtCreator 4.10.0 for Linux (Ubuntu).
    Trying to build a code I've used for years now I get a new behavior of the IDE. The code is compiled without any error and works as expected but the editor is full of issues (errors) and I'm not sure why they appears only now.

    issues.jpg

    Here the header of my class:

    #ifndef OPENAMP_H
    #define OPENAMP_H
    
    #include <QObject>
    #include <QQueue>
    #include <QSerialPort>
    
    class OpenAMP : public QSerialPort
    {
        Q_OBJECT
    
    public:
        typedef enum
        {
            Closed,
            Open,
            Error
        } States;
    
        explicit OpenAMP(QObject *parent = nullptr);
        ~OpenAMP();
        using QSerialPort::open;
        void closePort();
    
    private:
        QQueue<QByteArray> _queue;
        void dequeue();
        void writeMessage(QByteArray data);
    
    signals:
        void lineReceived(QByteArray line);
        void stateChanged(QString port, OpenAMP::States state);
    
    private slots:
        void onReadyRead();
    
    public slots:
        void openPort();
        void sendMessage(QByteArray data);
    };
    
    Q_DECLARE_METATYPE(OpenAMP::States)
    
    #endif // OPENAMP_H
    

    Is there something new in Qt code guidelines? Perhaps my code is formally correct (because it compiles and runs) but discouraged in any way?

    S 1 Reply Last reply
    1
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @Mark81 said in Lot of errors but it builds and runs successfully:

      for Linux (Ubuntu).
      Trying to build a code I've used for years now I get a new behavior of the IDE.

      The new behaviour is caused by the new Clang Code Model.

      See https://forum.qt.io/topic/100762/qt-creator-clang-code-model-problems-collection/ -- You can disable the Clang Code Model and revert to the old behaviour.

      The code is compiled without any error and works as expected but the editor is full of issues (errors) and I'm not sure why they appears only now.

      The Clang Code Model uses a desktop compiler to parse the code. The desktop compiler's environment settings are different from your cross-compiler's environment settings, which is probably why it encounters errors.

      Notice that the false errors are marked by a red circle with a black center. Real errors that are produced by your cross-compiler will be marked by a solid red circle with a red center.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      6
      • MehrshadM Offline
        MehrshadM Offline
        Mehrshad
        wrote on last edited by
        #3

        @JKSH said in Lot of errors but it builds and runs successfully:

        The desktop compiler's environment settings are different from your cross-compiler's environment settings, which is probably why it encounters errors.

        I'm facing the same problem but with Qt 6.5.2 and Qt Creator 11.0.0 on a Mac. Isn't there a way to modify the desktop compiler's environment settings?

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
        • MehrshadM Mehrshad referenced this topic on
        • M Mark81

          I cross-compiled Qt5.13 for ARM A7 and then I downloaded QtCreator 4.10.0 for Linux (Ubuntu).
          Trying to build a code I've used for years now I get a new behavior of the IDE. The code is compiled without any error and works as expected but the editor is full of issues (errors) and I'm not sure why they appears only now.

          issues.jpg

          Here the header of my class:

          #ifndef OPENAMP_H
          #define OPENAMP_H
          
          #include <QObject>
          #include <QQueue>
          #include <QSerialPort>
          
          class OpenAMP : public QSerialPort
          {
              Q_OBJECT
          
          public:
              typedef enum
              {
                  Closed,
                  Open,
                  Error
              } States;
          
              explicit OpenAMP(QObject *parent = nullptr);
              ~OpenAMP();
              using QSerialPort::open;
              void closePort();
          
          private:
              QQueue<QByteArray> _queue;
              void dequeue();
              void writeMessage(QByteArray data);
          
          signals:
              void lineReceived(QByteArray line);
              void stateChanged(QString port, OpenAMP::States state);
          
          private slots:
              void onReadyRead();
          
          public slots:
              void openPort();
              void sendMessage(QByteArray data);
          };
          
          Q_DECLARE_METATYPE(OpenAMP::States)
          
          #endif // OPENAMP_H
          

          Is there something new in Qt code guidelines? Perhaps my code is formally correct (because it compiles and runs) but discouraged in any way?

          S Offline
          S Offline
          SuperSelrak
          wrote on last edited by
          #4

          @Mark81 Same here with Qt Creator 7.0.2

          Nothing is defined, no files seem successfully included.

          All of a sudden too ! It was working very recently.

          MehrshadM 1 Reply Last reply
          0
          • S SuperSelrak

            @Mark81 Same here with Qt Creator 7.0.2

            Nothing is defined, no files seem successfully included.

            All of a sudden too ! It was working very recently.

            MehrshadM Offline
            MehrshadM Offline
            Mehrshad
            wrote on last edited by Mehrshad
            #5

            @SuperSelrak. This bug has been fixed in Qt Creator 11.0.1.

            Btw, are you using CMake for your project? If so, what version?

            S 1 Reply Last reply
            1
            • MehrshadM Mehrshad

              @SuperSelrak. This bug has been fixed in Qt Creator 11.0.1.

              Btw, are you using CMake for your project? If so, what version?

              S Offline
              S Offline
              SuperSelrak
              wrote on last edited by
              #6

              @Mehrshad Thank you. What's the earliest version you know that it has been fixed in ? I don't want to spend the time jumping to a new Qt Creator - either I have to do it on my own and deal with the issues that will surely come up, or wait for the support people to do it.

              Yes I use CMake 3.27.7. Why ?

              MehrshadM 1 Reply Last reply
              0
              • S SuperSelrak

                @Mehrshad Thank you. What's the earliest version you know that it has been fixed in ? I don't want to spend the time jumping to a new Qt Creator - either I have to do it on my own and deal with the issues that will surely come up, or wait for the support people to do it.

                Yes I use CMake 3.27.7. Why ?

                MehrshadM Offline
                MehrshadM Offline
                Mehrshad
                wrote on last edited by
                #7

                @SuperSelrak, as I stated earlier, the bug has been fixed in Qt Creator 11.0.1.

                If you are not willing to update Qt Creator, try CMake 3.26.x or earlier.

                Let me know if the problem still persists.

                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