Código:
es decir, no entiendo lo de undefined reference to crearJugadorjoc.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
La función des de la que llamo a crearJugador es esta:
Código:
y crearJugador es asi:void Joc::seleccionarPrimerJugador(const string& nom) throw (Joc::JugadorInexistente) { CatalogoJugadores catalogo; _jugador1 = catalogo.crearJugador(nom); }
Código:
A ver si alguien puede abrirme una luz. Muchas gracias por adelantado!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(); }
salu2