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

sari210

macrumors newbie
Original poster
Jun 8, 2009
9
0
St. Paul, MN
I'm learning how to do basic c++ programming and the basic programs that I am starting to write do not work. Xcode stops building the program at a cout line. The error I get is GBD: Stopped at breakpoint 1 (hit count : 1) - 'Line:13'.

I am sure this is probably a basic flaw in my program but any help that could be offered I will gladly take! Thanks!
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
I'm learning how to do basic c++ programming and the basic programs that I am starting to write do not work. Xcode stops building the program at a cout line. The error I get is GBD: Stopped at breakpoint 1 (hit count : 1) - 'Line:13'.

I am sure this is probably a basic flaw in my program but any help that could be offered I will gladly take! Thanks!

This looks like you set a breakpoint, started the debugger, and it promptly stopped at the breakpoint. Do you get any error messages if you use Command-B (Build)? Any errors with Command-R (Run)?
 

sari210

macrumors newbie
Original poster
Jun 8, 2009
9
0
St. Paul, MN
No errors?

I do not get any errors with Build, or with run, but then it does not actually execute the program.
When I look at the build results, it says build succeeded. I am at a loss.

Thank you!
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
I do not get any errors with Build, or with run, but then it does not actually execute the program.
When I look at the build results, it says build succeeded. I am at a loss.

Thank you!

When you create a new project, XCode automatically creates two build configurations: Debug and Release. In the project window (Command-0, that is Command-Zero) check what is your "Active Build Configuration". It is probably "Debug". In the source code window, check whether you have any breakpoints set: Big blue error to the left of the source code, probably in line 13 because that is where the debugger said it is stopping. That tells the debugger "when this program is started using the debugger, then stop at this line". That's what's happening.

To enter the debugger window when this happens, press Command-Shift-Y. The debugger can show you which line of the program is executing, what values your variables have, you can step line by line etc. Or press continue and your program runs to the end, or to the next breakpoint.

To see the output of your program, press Command-Shift-R. This will show the console window, and that is where your output goes.

To see a window with a list of all breakpoints, press Command-Shift-B. If you don't want to use breakpoints, you can remove breakpoints there.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.