Xcode Extremely Basic Question

I took a C++ course in high school and am trying to relearn what I knew with some basic programs, using Xcode as a compiler.
So far I've tried Hello World and a very basic program using variables.
Each time I get an error along the lines of:
Command /Developer/usr/bin/g++-4.0 failed with exit code 1

ld: duplicate symbol _main in /Users/me/Documents/VariablesDataTypes/build/VariablesDataTypes.build/Debug/VariablesDataTypes.build/Objects-normal/i386/main.o and /Users/me/Documents/VariablesDataTypes/build/VariablesDataTypes.build/Debug/VariablesDataTypes.build/Objects-normal/i386/Variables.o

I've done some pretty extensive searching of these forums and google and other forums, and have come upon one or two similar questions, but the answers didn't help/make any sense to me. I feel like this is something simple that I'm just missing but any help would be greatly appreciated.
Post your code so we can take a look at it.

Return 0;


#include <iostream>


using namespace std;

int main ( )

{

int a, b; //declaring variables
int result;

a = 2; //process
b = 5;
a = a + 1;

cout << result; //print out result

return 0; //terminate the program







}
I'm not really familiar with xcode and use Visual C++ Express. I've encountered a similar error if I have another cpp file in the same project folder that has a main function.
I think Return 0 is right, the file seems to be Variables.cpp
It looks as being linked with main.cpp in the same program, you don't need to move the real file location, just exclude it from compilation
Awesome, it worked, thanks!

Haha okay time for problem 2:
It says the debugging ended normally, and says it succeeded, but no windows or anything are showing up.
Add a cin.ignore(1); before return 0;, as of now it is opening, running the code, and before you see anything, it returns 0 and exits.
when are u setting value to result?
and system("PAUSE"); i know isn't the best way to pause it, but it should work.
Don't, please don't, start a debate about this. (You have been preemptively reprimanded.)

Look at this horror of a topic: http://www.cplusplus.com/forum/beginner/1988/
That's what happens when an argument starts over this issue.
I see nobody starting a debate on the method used to pause the console?

That topic is a horror - I hate seeing it there :(
Topic archived. No new replies allowed.