This is the Foo.hpp
#ifndef Foo_hpp
#define Foo_hpp
#include <stdio.h>
#include "Bar.hpp"
class Bar;
class Foo
{
private:
int z;
public:
void addY(Bar &x);
};
#endif /* Foo_hpp */
This is the Bar.hpp
#ifndef Bar_hpp
#define Bar_hpp
#include <stdio.h>
#include "Foo.hpp"
class Bar
{
private:
int y;
public:
friend void Foo::addY(Bar&);//use of undeclared identifier 'Foo'
};
#endif /* Bar_hpp */
I dont even know why it keeps giving me this error, I try to work on it and try to see if I misspell or mistype anything. I even try to rewrite everything form scratch and still come up with the same error.