Multiple define symbol errors?

I'm writing a program to create sets based off of BitVectors. I don't have much code written and it already wont compile due to some sort of multiple define problem that I cannot find. What is wrong here?

#define WORD unsigned long int

class BitVectorSet
{
public:

//Constructor
BitVectorSet();
//Destructor
~BitVectorSet();
//Adds a # to a set.
void AddItem(int data);
//Removes a # from a set.
void RemoveItem(int data);
//Preforms the union of two sets.
void Union(BitVectorSet One, BitVectorSet Two);
//Preforms intersection of two sets.
void Intersection(BitVectorSet One, BitVectorSet Two);
//Tests to see if two sets are equal.
int AreEqual();
//Tests to see if a # is in a set.
int PartOfSet(int data);

private:
WORD Set[4];
};

/*Constructor. Each time a set is made a new universe
is created.Set the universe to 0. */
BitVectorSet::BitVectorSet()
{
for(int i =0 ; i < 3; i++)
Set[i] = 0;
}

//Destructor
BitVectorSet::~BitVectorSet()
{

}


My other CPP file contains


#include <iostream>
#include <conio.h>
#include "Bit-Vector Set Object.cpp"
using namespace std;

int main ()
{

BitVectorSet SetOne;

_getch();
return 0;
}

Here are the errors:

Error 1 error LNK2005: "public: __thiscall BitVectorSet::BitVectorSet(void)" (??0BitVectorSet@@QAE@XZ) already defined in Bit-Vector Set Object.obj Bit-Vector set implementation.obj
Error 2 error LNK2005: "public: __thiscall BitVectorSet::~BitVectorSet(void)" (??1BitVectorSet@@QAE@XZ) already defined in Bit-Vector Set Object.obj Bit-Vector set implementation.obj
Error 3 fatal error LNK1169: one or more multiply defined symbols found G:\Programs\CIS 226\Set Implementation using a Bit-Vector\Debug\Set Implementation using a Bit-Vector.exe 1





Do not include .cpp files.

You need to split your Bit-Vector Set Object.cpp into two files - a header file (.h) and an implementation file (.cpp)
The header file should contain the class declaration, the implementation file should contain the implementation of
the class methods. Then #include the header file.
That did the trick!! Thank you very much.
Topic archived. No new replies allowed.