Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. many incomprehensible errors

many incomprehensible errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.3k 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.
  • F Offline
    F Offline
    filipdns
    wrote on 27 Apr 2019, 09:38 last edited by
    #1

    Hello, trying to compile project, I receive many errors but I don't understand why because the code is simple and that is no reason to get this ...

    here the mainwindow.h for exemple:

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    #include <QPixmap>
    #include <QTimer>
    #include <iostream>
    
    #include <opencv2/highgui/highgui.hpp>
    #include <opencv2/core/core.hpp>
    
    
    using std::cout;
    using std::endl;
    
    
    class Vehicule;
    class Alarme;
    class Camera;
    class ThreadCam;
    
    namespace Ui {
    class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
    
    private:
        ThreadCam* threadCamera;
        QPixmap qPixVoySurvitesse, qPixVoyBlack, qPixLogo;
        Vehicule* monVehicule;
        Alarme* monAlarme;
        Ui::MainWindow *ui;
        QTimer* timerRefreshVit;
        QTimer* timerFps;
        QTimer* timerLaunchedThread;
    public slots:
        void sltReceiveCamImage(QPixmap img);
        void sltRefreshCompteur();
        void sltShowAlarmeVoyantTick();
        void sltHideAlarmeVoyantTick();
        void sltReceiveCamFps(int framePerSecond);
        void sltCamNotFound();
    private slots:
        void on_cvPRondAvertVisu_clicked(bool checked);
        void on_cvPRondAvertSon_clicked(bool checked);
        void on_sliderCompteur_sliderMoved(int position);
    };
    
    #endif // MAINWINDOW_H
    
    

    the .pro file had
    QT += core gui multimedia widgets qml

    and here the errors return by Qt creator:
    0_1556357553490_errors.png

    0_1556357691023_errors2.png

    Could you help me to understand where errors are come from?...

    thank you very much

    A 1 Reply Last reply 27 Apr 2019, 09:48
    0
    • F filipdns
      27 Apr 2019, 09:38

      Hello, trying to compile project, I receive many errors but I don't understand why because the code is simple and that is no reason to get this ...

      here the mainwindow.h for exemple:

      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      #include <QPixmap>
      #include <QTimer>
      #include <iostream>
      
      #include <opencv2/highgui/highgui.hpp>
      #include <opencv2/core/core.hpp>
      
      
      using std::cout;
      using std::endl;
      
      
      class Vehicule;
      class Alarme;
      class Camera;
      class ThreadCam;
      
      namespace Ui {
      class MainWindow;
      }
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          explicit MainWindow(QWidget *parent = 0);
          ~MainWindow();
      
      private:
          ThreadCam* threadCamera;
          QPixmap qPixVoySurvitesse, qPixVoyBlack, qPixLogo;
          Vehicule* monVehicule;
          Alarme* monAlarme;
          Ui::MainWindow *ui;
          QTimer* timerRefreshVit;
          QTimer* timerFps;
          QTimer* timerLaunchedThread;
      public slots:
          void sltReceiveCamImage(QPixmap img);
          void sltRefreshCompteur();
          void sltShowAlarmeVoyantTick();
          void sltHideAlarmeVoyantTick();
          void sltReceiveCamFps(int framePerSecond);
          void sltCamNotFound();
      private slots:
          void on_cvPRondAvertVisu_clicked(bool checked);
          void on_cvPRondAvertSon_clicked(bool checked);
          void on_sliderCompteur_sliderMoved(int position);
      };
      
      #endif // MAINWINDOW_H
      
      

      the .pro file had
      QT += core gui multimedia widgets qml

      and here the errors return by Qt creator:
      0_1556357553490_errors.png

      0_1556357691023_errors2.png

      Could you help me to understand where errors are come from?...

      thank you very much

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 27 Apr 2019, 09:48 last edited by
      #2

      @filipdns These errors come from the Clang Code Model, which I assume has problems parsing one of the headers you included.

      Does it work with a default created project from the wizard ("Qt Widgets Application")?

      Which Qt creator version are you using on which platform?

      Qt has to stay free or it will die.

      F 1 Reply Last reply 27 Apr 2019, 09:51
      2
      • A aha_1980
        27 Apr 2019, 09:48

        @filipdns These errors come from the Clang Code Model, which I assume has problems parsing one of the headers you included.

        Does it work with a default created project from the wizard ("Qt Widgets Application")?

        Which Qt creator version are you using on which platform?

        F Offline
        F Offline
        filipdns
        wrote on 27 Apr 2019, 09:51 last edited by
        #3

        @aha_1980 hi aha, I'm on windows 10, Qt 5.11 MSVC2015 / 64 and yes created default project work fine...

        A 1 Reply Last reply 27 Apr 2019, 09:55
        0
        • F filipdns
          27 Apr 2019, 09:51

          @aha_1980 hi aha, I'm on windows 10, Qt 5.11 MSVC2015 / 64 and yes created default project work fine...

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 27 Apr 2019, 09:55 last edited by
          #4

          @filipdns

          The code model might have problems with the OpenCV headers.

          You can try to use the latest version of Qt Creator (you didn't mention which version you actually using). If that does not help, you can disable Clang with Help > About Plugins > Clang Code Model.

          Qt has to stay free or it will die.

          F 1 Reply Last reply 27 Apr 2019, 10:07
          2
          • A aha_1980
            27 Apr 2019, 09:55

            @filipdns

            The code model might have problems with the OpenCV headers.

            You can try to use the latest version of Qt Creator (you didn't mention which version you actually using). If that does not help, you can disable Clang with Help > About Plugins > Clang Code Model.

            F Offline
            F Offline
            filipdns
            wrote on 27 Apr 2019, 10:07 last edited by
            #5

            @aha_1980 I'm using creator 4.8.2, disable Clang don't show errors any more but I still don't know why I get theses errors on this project and not on other one...

            A 1 Reply Last reply 1 May 2019, 05:12
            0
            • F filipdns
              27 Apr 2019, 10:07

              @aha_1980 I'm using creator 4.8.2, disable Clang don't show errors any more but I still don't know why I get theses errors on this project and not on other one...

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 1 May 2019, 05:12 last edited by
              #6

              @filipdns As said, most often the problems arise when a header file cannot be parsed correctly. Debugging these problems is a tedious task, though.

              If you want to do it, start with a minimal project, then start adding the OpenCV headers in a .cpp file. At some point it will start to break. Then at least you know the guilty header and can investigate more.

              Regards

              Qt has to stay free or it will die.

              1 Reply Last reply
              2

              5/6

              27 Apr 2019, 10:07

              • Login

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