Classic "undefined reference" problem, headers... :s
Hey guys i've been getting this error lately... I think i should learns how to solve it once for all.
i declare a class "Libro" which stands for Book in english, anyway when i try to define the functions one get This error:
undefined reference to `Libro::setAll(std::string, std::string, std::string, std::string, std::string)' but apparently to me i did it ok :P(crying in the inside)
libro.h
Code:
#include<string>
using namespace std;
class Libro
{
string titulo;
string autor;
string editora;
string fechaPublicacion;
string categoria;
Libro *siguiente;
//Libro *anterior;
public:
void setAll(string,string,string,string,string);
void setSiguiente(Libro *siguiente);
Libro *getSiguiente();
string getCategoria();
string getAutor();
string getTitulo();
};
libro.cpp
Code:
#include"libro.h"
void Libro::setAll(string titulo,string autor,string editora,string fechapu,string categoria)
{
this->titulo = nombre;
this->autor = autor;
this->editora = editora;
this->fechaPublicacion = fechapu;
this->categoria = categoria;
}
void Libro::setSiguiente(Libro *libro)
{
this->siguiente = libro;
}
Libro* Libro::getSiguiente()
{
return this->siguiente;
}
string Libro::getCategoria()
{
return this->categoria;
}
string Libro::getAutor()
{
return this->autor;
}
string Libro::getTitulo()
{
return this->titulo;
}
Help please, any recomendations let me know im a notebook with blank pages :D