Friendly function between classes

0

Good morning,

I have a problem with the declaration of a friendly function:

#ifndef _TABLERO_H_
#define _TABLERO_H

#include "matriz.h"
#include "jugador.h"

class Tablero {
     friend int Jugador::escogePosicion(Tablero& tab);
    ....
    ....
}

When compliar tells me that the Player class is not declared, it is exactly this error:

In file included from include/jugador.h:4:0,
                 from include/tablero.h:5:
include/tablero.h:8:17: error: ‘Jugador’ has not been declared
      friend int Jugador::escogePosicion(Tablero& tab);
                 ^

If I have the include of the file with the Player statement, why do you give me that error?

    
asked by Hesterions 03.06.2017 в 20:47
source

0 answers