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.
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