I'm a C++ noob, have been using Terminal/gcc to compile and run my code, but wanted to make the switch to Xcode (v 3.2.5). I've been going through some tutorials but having problems getting the Debugger to work properly.
When I select Build and Debug, if my code has no errors, the Debugger and Debugger Console open and I get a message in the console that debugging ended normally.
When there are errors in the code, I get red error icons in the Editor, but neither the Debugger nor the console open automatically. This i开发者_如何转开发sn't a big deal, I can manually open the Debugger. What is a problem is that when I do open it, it's completely empty: nothing at all in the threads, vars or editor panes.
I'm using the default build configuration for the template Command Line Tool > C++ stdc++ (Generate Debug Symbols: on, Strip Debug Symbols: off, Optimization: off). I read the "Troubleshooting Debugger Display" section in the Xcode Debugging Guide and it seems like I'm doing all those things correctly, but as I said, I'm a beginner, so maybe I'm overlooking something really obvious? Appreciate any help, thanks!
Based on your statement about red error icons in the editor, it sounds like you have compile-time errors in your program.
I think you might be confused about what a debugger is for - it's used to find runtime errors with your code, not compile-time errors. The debugger won't be any use to you if your code isn't syntactically correct.
精彩评论