Saturday, 31 August 2013

Undefined reference to function in class

Undefined reference to function in class

main.cpp:
#include <iostream>
#include "pokemonList.h"
void pokemonLookup();
int main() {
pokemonLookup();
return 0;
}
void pokemonLookup() {
pokemonList pL;
std::cout<<std::endl<<"What Pokemon do you want to look up? ";
std::string pokemonLookup;
std::cin>>pokemonLookup;
pL.displayPokemon(pokemonLookup);
}
pokemonList.h:
#ifndef POKEMONLIST_H
#define POKEMONLIST_H
#include <iostream>
class pokemonList
{
private:
struct pokemonTemplate {
std::string pokemonName;
std::string pokemonMoves[3];
int pokemonLevel;
int baseATK;
int baseDEF;
int baseSPATK;
int baseSPDEF;
int baseSPEED;
};
pokemonTemplate bulbasaur;
pokemonTemplate pikachu;
public:
void displayPokemon(std::string pokemon);
protected:
};

No comments:

Post a Comment