Redefinition of base class methods error

When I try to run program8.cpp, I get an error that I'm redefining all of the base class' methods.

Example:
[Error] redefinition of 'Species::Species()'
etc. etc. for all of Species' (the base class) methods.

Mammalian and Reptilian both inherit from Species.


I'm almost certain this is an include error. I have include guards on all my .h files.

Here's what I'm including in each file:

Species.h:
Nothing

Species.cpp:
Species.h

Mammalian.h:
Species.cpp

Mammalian.cpp:
Mammalian.h

Reptilian.h:
Species.cpp

Reptilian.cpp:
Reptilian.h

program8.cpp (main):
Mammalian.cpp
Reptilian.cpp

EDIT:
After some digging around, I've found that apparently not supposed to include .cpp files. However, when I including the corresponding .h files instead of the .cpp files, I'm getting undefined errors.

EDIT 2:
Was using Dev-C++, didn't have the files in the same project so they weren't linking right. All is well.
Last edited on
Topic archived. No new replies allowed.