I'm compiling it with g++ zoo.cpp Animal.cpp -o out and keep getting the following errors:
The function definition and declarations match as well. I had it working before but I can't figure out what changed or what the referencing means. The "Animal.h" header file is included in both .cpp files.
zoo.cpp
#include "Animal.h"
#include <iostream>
using namespace class1020;
int main( int argc, char** argv )
{
Animal* zoo = Zoo( 3, 2, 10, 10 );
ShowTheZoo(zoo);
for( int i=0;i<15;i++ )
{
std::cout << "\t\tYEAR " << i << std::endl;
SpawningCycle(zoo);
FeedingCycle(zoo);
zoo = AgingCycle(zoo);
ShowTheZoo(zoo);
}
CleanTheZoo(zoo);
return 0;
}
Animal.cpp
#include "Animal.h"
#include <iostream>
using namespace class1020;
Animal* Zoo(int numBirds, int numWorms, int numWolves, int numHares){}
void SpawningCycle(Animal* linkedlist){}
void FeedingCycle(Animal* linkedlist){}
Animal* AgingCycle(Animal* linkedlist){}
void ShowTheZoo(Animal* linkedlist){}
void CleanTheZoo(Animal* linkedlist){}
Animal.h
#ifndef ANIMAL_H
#define ANIMAL_H
#include <string>
namespace class1020
{
class Animal
{
public:
Animal(int lifespan, std::string anim_type);
virtual ~Animal();
virtual Animal* produceOffspring() = 0;
private:
Animal();
};
Animal* Zoo(int numBirds, int numWorms, int numWolves, int numHares);
void SpawningCycle(Animal* linkedlist);
void FeedingCycle(Animal* linkedlist);
Animal* AgingCycle(Animal* linkedlist);
void ShowTheZoo(Animal* linkedlist);
void CleanTheZoo(Animal* linkedlist);
};
#endif