I wanna study the C++ in XCode. After installing, I just inputted a following sample code,
#include <iostream>
using namespace std;
int main()
{
int iterations = 0;
bool continue_loop = true;
while ( continue_loop != false )
{
iterations++;
cout << "the while loop has executed "
<< iterations << " times\n";
if ( iterations == 5 )
continue_loop = false;
}
return 0;
}
but the XCode said "it is fail", the reason is
"duplicate symbol _main in /Users/roger/Documents/Try/build/Try.build/Debug/Try.build/Objects-normal/x86_64/Try.o and /Users/roger/Documents/Try/build/Try.build/Debug/Try.build/Objects-normal/x86_64/main.o"
so please help me, is it my mistake to install the xcode or open a wrong file, or some reasons.
Thank you very much..........
#include <iostream>
using namespace std;
int main()
{
int iterations = 0;
bool continue_loop = true;
while ( continue_loop != false )
{
iterations++;
cout << "the while loop has executed "
<< iterations << " times\n";
if ( iterations == 5 )
continue_loop = false;
}
return 0;
}
but the XCode said "it is fail", the reason is
"duplicate symbol _main in /Users/roger/Documents/Try/build/Try.build/Debug/Try.build/Objects-normal/x86_64/Try.o and /Users/roger/Documents/Try/build/Try.build/Debug/Try.build/Objects-normal/x86_64/main.o"
so please help me, is it my mistake to install the xcode or open a wrong file, or some reasons.
Thank you very much..........