Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

xcode 4 console problem?

dunno why but my console won't display my simple .cpp


#include <iostream>


using namespace std ;


int main()

{

cout << "hi" << endl;

return 0;

}


hmm any hints?

Xcode-OTHER, Mac OS X (10.7.2)

Posted on Feb 9, 2012 9:47 AM

Reply
5 replies

Feb 9, 2012 12:07 PM in response to mlm249

Some questions:


When you say the console doesn't display your output, do you mean that when you run the Xcode project, the debug area and console open in Xcode but no output is displayed?


If you create a C++ command-line tool project and run it, does the console display the Hello World output?


I have an article on my website that walks you through the creation of a C++ command-line application in Xcode 4. You can find it at the following URL:


http://www.meandmark.com/articles.html

May 9, 2012 7:56 AM in response to mlm249

I am having same problem but the link didnt help @ Mark


I have read all prior answers to similar questions and they all seem to pertain to displaying output for a Command Line project. But what if you'd like to run as what Xcode calls a 'Empty' (project with no files, targets or build configs)?

The code below builds successfully. And yet the 'All Output' console still does not show the results. I tried to go deep into the GDB documentation but I'm a newbie and I get lost in it.

Below is the code:

#include<iostream>                           usingnamespace std;
int main() {
cout
<<"Come up and C++ me some time.";
cout
<< endl;
cout
<<"You won't regret it!"<< endl;
std
::cout <<"Press any key to continue."<<endl;cin.get();cin.get();return0; }

xcode 4 console problem?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.