Error LNK...New to including separate header and cpp files

Before this, I want to let you know I am using Visual Studio. My problem is
fighter.obj : error LNK2005: "public: __thiscall fighter::fighter(void)" (??0fighter@@QAE@XZ) already defined in All out brawling.obj

I have tried for a while, and it is probably a simple mistake since I am new to including other files. This is what my code looks like:

fighter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef fighter_h
#define fighter_h
#include <string>
class fighter
{
public:
	std::string name;
	int stamina;
	bool alive;
	bool mark;
	bool turn;
	fighter();
};


#endif 


fighter.cpp
1
2
3
4
5
6
7
8
9
#include "fighter.h"

fighter::fighter()
{
	stamina=0;
	alive=true;
	mark=false;
	turn=false;
}


This is what the declarations in my main cpp file look like
1
2
3
4
5
6
7
8
9
#include <iostream>
#include <string>
#include <cstring>
#include <conio.h>
#include <time.h> 
#include <random>
#include <vector> 
#include "fighter.h"
#include "fighter.cpp" 
remove the #include "fighter.cpp" from main.cpp. Linking seperate .cpp files eliminates the need for including a .cpp file and linking is the correct way to do it.
Thanks
Topic archived. No new replies allowed.