many incomprehensible errors
-
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 qmland here the errors return by Qt creator:
Could you help me to understand where errors are come from?...
thank you very much
-
@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?
-
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.
-
@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