Multiple definition of 'main' error

#include <iostream>
#include <string>

using namespace std;

int main()
{
string name;
int age;

//Welcome Message

cout << endl;

cout << "Please supply a name: ";
cin >> name;

cout << "Please supply a number: ";
cin >> age;

cout << "There once was a person named " << name
<< "who had " << age << "toes." << endl;

cout << endl;

return 0;
}

The error that I am getting when I try to compile is this,

/tmp/ccmQurPr.o: In function `main':
p1.cpp:(.text+0x6c): multiple definition of `main'
/tmp/cc0MsUKR.o:lab1.cpp:(.text+0x6c): first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 95 in /tmp/cc0MsUKR.o to 248 in /tmp/ccmQurPr.o

I think the problem might have something to do with another .cpp file that I have that also uses int main(). Does anyone know how I can fix this?
Remove the other file from your project. How to do that depends on your ide.
Ok thanks, I'll try that.
Topic archived. No new replies allowed.