PDA

View Full Version : XCode & C++ : Cannot get program to run




AARRGGHHH
Nov 25, 2011, 04:03 AM
XCode version is 3.2.6 running on Snow Leopard. A simple C++ console program I'm working on is opening in the Debugger Console. But it doesn't do anything:

Loading program into debugger…
Program loaded.
run
[Switching to process 262]
Running…
$$$$$$$$$$$$$$$$$$ Welcome to THE GODFATHER Role Playing Game $$$$$$$$$$$$$$$$$$

Main Menu
---------

1) See Rules
2) Play Game
3) Quit

1
2
3
0
4


However, when I run it from Terminal, it works fine, so the issue is not the program itself. The issue seems related to XCode. I'm loading the code into XCode by starting a new project, and replacing the "Hello World" code in main with my code.



AARRGGHHH
Nov 28, 2011, 03:15 PM
I'd appreciate any suggestions on this one, the program continues to run fine when opened in the Unix terminal, but it won't run in XCode (and I need to debug it).

Thanks

lloyddean
Nov 28, 2011, 04:23 PM
Does this CLI program need to open any files?

Reason077
Nov 28, 2011, 04:36 PM
Any input you type into the debugger window goes to the debugger, not to your program.

If you want to debug an interactive CLI program as it runs, try attaching ("attach to process" command) to it after running it in a terminal window.

jiminaus
Nov 28, 2011, 07:15 PM
Any input you type into the debugger window goes to the debugger, not to your program.

Yes, but if the debugger is not stopped at a command prompt, then the debugger should pass the input through to the program.