Me aparece el siguiente error y no se cómo arreglarlo
Código:
joc.o(.text+0x22c): En la función `Joc::seleccionarPrimerJugador(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/root/Desktop/joc.cc:46: undefined reference to `CatalogoJugadores::crearJugador(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
collect2: ld devolvió el estado de salida 1
es decir, no entiendo lo de undefined reference to crearJugador
La función des de la que llamo a crearJugador es esta:
Código:
void Joc::seleccionarPrimerJugador(const string& nom)
throw (Joc::JugadorInexistente) {
CatalogoJugadores catalogo;
_jugador1 = catalogo.crearJugador(nom);
}
y crearJugador es asi:
Código:
Jugador* crearJugador(const string& nom)
throw (CatalogoJugadores::JugadorInexistente) {
if (nom == estilo1)
return new JugadorAleatori;
if (nom == estilo2)
return new JugadorCiclic;
if (nom == estilo3)
return new JugadorMemoria;
throw CatalogoJugadores::JugadorInexistente();
}
A ver si alguien puede abrirme una luz. Muchas gracias por adelantado!
salu2