XCode & C++ : Cannot get program to run

Discussion in 'Mac Programming' started by AARRGGHHH, Nov 25, 2011.

  1. AARRGGHHH, Nov 25, 2011
    Last edited: Nov 28, 2011

    macrumors newbie

    Joined:
    Nov 25, 2011
    #1
    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:

    Code:
    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.
     
  2. thread starter macrumors newbie

    Joined:
    Nov 25, 2011
    #2
    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
     
  3. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #3
    Does this CLI program need to open any files?
     
  4. macrumors 68000

    Reason077

    Joined:
    Aug 14, 2007
    #4
    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.
     
  5. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #5
    Yes, but if the debugger is not stopped at a command prompt, then the debugger should pass the input through to the program.
     

Share This Page