Program exited with status value: 1.

Discussion in 'Mac Programming' started by chomper, Jan 1, 2011.

  1. chomper macrumors newbie

    Dec 26, 2010
    Central Europe

    if I run my program in Xcode and my program returns the value of 1 in the main function or I call the exit(1) function anywhere in my code, the console displays this message:

    Program exited with status value: 1. (gdb)

    Here comes the but: If I try to run or build + run my program again, Xcode behaves as if my program were running - it shows the STOP EXECUTABLE dialog window asking me to terminate the program. Why?
  2. Sydde macrumors 68020


    Aug 17, 2009
    Velvet Green
    Exit status of zero indicates the program finished happily, no (0) worries mate. Any other exit status value indicates failure. Take a look at the debugger to see if it is retaining context (in order to help you figure out what went wrong).
  3. jiminaus macrumors 65816


    Dec 16, 2010
    Your program has existed, it's just the debugger that's hanging around. But because your program has existed, there nothing much you can do with the debugger.

    This seems to be a "mis-feature" of XCode 3. This behaviour has changed in the current developer preview of XCode 4. There the debugging session is closed regardless of the exit status of the program being debugged.

Share This Page