Error during compiling process

When trying to compile I get these errors:

Tabella.cpp:(.text+0x0): multiple definition of `tabella(char&, char&, char&, char&, char&, char&, char&, char&, char&)'

Tris.cpp:(.text+0x0): first defined here

[Error] ld returned 1 exit status

recipe for target 'Tris.exe' failed

main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include "Tabella.cpp"
using namespace std;

int main()
{
	char q,q2,q3,q4,q5,q6,q7,q8,q9;
	
	cout<<"Tris uno contro uno"<<endl;
	
	
	tabella(q,q2,q3,q4,q5,q6,q7,q8,q9);
	
	system("PAUSE");
	
}


tabella
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
using namespace std;

void tabella (char &q,char &q2,char &q3,
	      char &q4,char &q5,char &q6,
    	      char &q7,char &q8,char &q9)
{
	q=q2=q3=q4=q5=q6=q7=q8=q9='~';
		
	cout<<"-------"<<endl;
	cout<<"|"<<q<<"|"<<q2<<"|"<<q3<<"|"<<endl;
	cout<<"-------"<<endl;
	cout<<"|"<<q4<<"|"<<q5<<"|"<<q6<<"|"<<endl;
	cout<<"-------"<<endl;
	cout<<"|"<<q7<<"|"<<q8<<"|"<<q9<<"|"<<endl;
	cout<<"-------"<<endl;
}


If I am doing something wrong tell me how to fix it, thx.
You shouldn't be #including C++ source files, you need to add them to your compile line.
Could you share a wiki link or an explanation,please?

What don't you understand?

You need to compile the code, not #include the source file into some other file.

Now it works thx.
Last edited on
Topic archived. No new replies allowed.