Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TejasMehrotra

macrumors newbie
Original poster
Dec 14, 2009
5
0
Hi,

I am new to programming on Mac. I installed XCode 3.1.3 and was trying to write a C++ program 'Hello World' but I was unable to compile the program.

I wrote the program but the 'Build and Go' button is inactive. What am I suppose to do to activate the button or what am I suppose to do to compile a c++ program?

Enclosed: Pictures which might help you to understand my problem better.

21mgggy.png


250nmgw.png


23svrxy.png


Thanks a lot! :)

Tejas.
 
Did you create a new project or just a new file?

Because in Xcode you must create a project for it run. Just create a new project by going File -> New Project and selecting C++ command line application.

This will create all the files needed for Xcode to run the app.

Stephen
 
Thanks!

Thanks a lot Stephan. I really appreciate your help.

It worked! :)

Although, it said "Succeeded" but now the problem is that where do I see the output from?

Sorry to bug you with my super duper "rookie" questions.

Thanks a lot! :)

Tejas.
 
To solve this you need to open Xcode's preferences by going Xcode -> Preferences, then navigate to "Debugging" and next to "On Start" use the drop down box to select "Show Console". Apply the changes and build and run your app again.

And no question is a rookie question, everyone starts somewhere.

Stephen
 
Did you create a new project or just a new file?

Because in Xcode you must create a project for it run. Just create a new project by going File -> New Project and selecting C++ command line application.

This will create all the files needed for Xcode to run the app.

Stephen

So I'm having the exact same problem and I don't have the "C++ command line application" option... What am I to do? Went through:

File -> New project
Framework & Library -> "STL C++ Library"

"Run/Build" is inactive...
There are no errors, there is a check mark next to it indicating what I assume is that it is error-free...

I'm at my wit's end. In Eclipse, I merely have to save to run my program, but it seems Xcode requires more protocol. What am I to do?

PS - I'm running Xcode 3.2.6
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.