Constructor multiple definition

Could someone please tell me why I'm receiving a multiple definition error. I simplified the code to a basic skeleton that still exerts the error. Its driving me mad lol.

main.cpp
1
2
3
4
5
6
7
8
9
10
11
#include<iostream>
#include"list.cpp"

int main()
{



	return 0;
}

list.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef LIST_H_INCLUDED
#define LIST_H_INCLUDED
#include<cstdlib>
#include<iostream>

using namespace std;



class list{
private:
public:
	list();
};




#endif // LIST_H_INCLUDED


list.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <cstdlib>
#include <iostream>
#include "list.h"
using namespace std;


list::list(){


}



change this #include"list.cpp" to this #include"list.h"
Include "list.h" instead of "list.cpp".
So simple, thanks. I was becoming aggravated.
Topic archived. No new replies allowed.