Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/05/2005, 04:08
yogurete
 
Fecha de Ingreso: mayo-2005
Mensajes: 68
Antigüedad: 19 años, 9 meses
Puntos: 0
c++ a qué se debe este error?

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