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

deanrayj

macrumors newbie
Original poster
Apr 25, 2008
5
0
I've been using XCode 1.5 to teach myself some simple C++ through the command line utility there. My old laptop had some issues, so I ended up upgrading to a new Intel Mac and installed XCode 3.0. I've found that the XCode 3.0 no longer uses a separate window for the debugging (gcc) console and the command line I/O - it supposedly uses the debugger console window for both, passing input to the console when paused and to the program when running.

However, I've written a couple of simple programs on the new XCode, and while the window displays all of the output correctly, I can't seem to add any inputs (through cin). When the program prompts me for an input, I type a number and hit return, but the cursor simply jumps to the next line. It doesn't appear to be passing the number through to gcc as a debug prompt, and when I run the program through the debugger, the variable inspector indicates that the number isn't getting through to the variable in the first place.

I've looked through most of the preferences, tried switching between Release and Debug builds, and I'm not finding any reason that it won't be accepting the user input. Is there something else that I'm missing?
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
Download and install Xcode 2.5 from Apple's developer site. You can run Xcode 2.5 on Leopard along with Xcode 3, and it gives you the Standard I/O Log toddburch mentioned.
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
I wish I had a better solution for you. I created a C++ Tool project in Xcode 3 as a test, and I was able to enter input from the debugger console. It just worked for me. I don't know why it doesn't work for you. Installing Xcode 2.5 will get you back programming faster than trying to figure out what you have to do to get command line input to just work for you.
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
Someone emailed me today with a solution. Choosing Run > Sync With Debugger made the console accept input. I can't verify the solution works because the console worked for me, but I figured I should share the solution in case someone searches the forum with a similar problem.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.