I have the following files and I don't understand why it doesn't work and why I obtain
'Pixel' was not declared in this scope
Here the header:
#ifndef TABRESULTATS_H #define TABRESULTATS_H #include "Ligne.h" #include <iostream> #include <cmath> #include "Pixel.h" #include <vector> using namespace std; class Tableresultats { public: Tableresultats(vector<Pixel> pixels); Tableresultats(vector<Pixel> pixels, int seuil); Tableresultats(); virtual ~Tableresultats(); protected: private: vector<int> m_debut; vector<int> m_duree; vector<int> m_valeurMax; int m_seuilGris; }; #endif // TABRESULTATS_H The .cpp:
#include "Tableresultats.h" #include "Ligne.h" #include <iostream> #include <cmath> #include "Pixel.h" #include <vector> using namespace std; int vmaxTemp; int dureeTemp; Tableresultats::Tableresultats(); { m_seuilGris=180; //valeur par defaut vector<int> debut(); vector<int> duree(); vector<int> vmax(); //ctor } Tableresultats::Tablesreultats(vector<Pixel> pixels); { // ... } Tableresultats::Tableresultats(vector<Pixel> pixels, int seuil); { m_seuilGris=seuil; //valeur par defaut // ... } Tableresultats::~Tableresultats() { } And my class pixel:
#ifndef PIXEL_H #define PIXEL_H #include <iostream> #include "Tableresultats.h" using namespace std; class Pixel { public: ... protected: private: int m_couleurRGB[3]; //La couleur du pixel int m_niveauGris; //Niveau gris int m_posX; //reference X int m_posY; //reference Y }; #endif // PIXEL_H I have other files but I don't understand why I have this problem:
Pixel was not declared in this scope, line 16 Tableresultats.h header
if I have declared #include <vector> and #include "Pixel.h"