According to the C++ Primer book, the author mentioned that We can specify a class member function as a friend of another class, instead of the entire class (page 634).
For this to work, the full definition of B needs to be known before the definition of A.
So forward declare A, since B doesn't need the full type, and switch the definitions around:
class A;
class B
{
public:
void fB(A& a){};
void fB2(A& a){};
};
class A
{
public:
friend void B::fB(A& a);
void fA(){}
};