Hey everyone. I recently got a MacBook Pro as a Graduation/B-day present. I enjoy messing with programming and am going to be helping out a friend with C++ this summer. I want to be able to write and compile code on my Mac, so I downloaded and installed Xcode. Then to test it out, I wrote a simple code and tried to compile it. For a step by step guide, here is what I did:
I opened a new project, then selected C++ Tool from the Command Line Utility. Next I named the project Test. I then control-clicked the project and added a new C++ file from the C and C++ drop down list. I then wrote this simple test code in the file:
Finally I tried to build and run it, but every time I attempted to build it, it would say that there were two errors. Each of them said this:
[quote="Error]
Command /Developer/usr/bin/g++-4.0 failed with exit code 1
[/quote]
The compiler then quits. I have no idea why this isn't working, but I'm hoping it's just something simple that I'm overlooking or a simple file I haven't configured. Any help would be much appreciated. Thanks a bunch.
I opened a new project, then selected C++ Tool from the Command Line Utility. Next I named the project Test. I then control-clicked the project and added a new C++ file from the C and C++ drop down list. I then wrote this simple test code in the file:
Code said:#include <iostream>
using namespace std;
int main()
{
cout << "It works." << endl;
return 0;
}
Finally I tried to build and run it, but every time I attempted to build it, it would say that there were two errors. Each of them said this:
[quote="Error]
Command /Developer/usr/bin/g++-4.0 failed with exit code 1
[/quote]
The compiler then quits. I have no idea why this isn't working, but I'm hoping it's just something simple that I'm overlooking or a simple file I haven't configured. Any help would be much appreciated. Thanks a bunch.