I have two classes, Camera and Pixel. Camera has a vector of vector of Pixel (2D array) and Pixel uses static member functions from Camera.
In my Camera file I include my Pixel.hpp header before declaring the Camera class, so the compiler goes to the Pixel.hpp file, reads it and stops when it finds the call to the static member function saying:
src/../hdr/Pixel.hpp: In member function ‘void Pixel::ComputeVector()’:
src/../hdr/Pixel.hpp:32:26: error: ‘Camera’ has not been declared
Vect2 screenSize = Camera::Instance().GetScreenSize();
I tried to do a forward declaration of Camera before the declaration of the Pixel class but it says:
src/../hdr/Pixel.hpp: In member function ‘void Pixel::ComputeVector()’:
src/../hdr/Pixel.hpp:33:26: error: incomplete type ‘Camera’ used in nested name specifier
Vect2 screenSize = Camera::Instance().GetScreenSize();
And sometimes it considers forward declaration as errors...
I don't know what to do, I hope you'll help me with this problem, thank you for your attention