New to C++ Compiling

I'm taking an algorithm design course for college and it requires a C++ Compiler. I downloaded Visual C++ Express 2008, but can't register it, so I decided to stick with the native Xcode 3.2. I am only having one problem that I can't understand between Visual C++ and Xcode, and that's something about breakpoints. When I run this program"

and build it I don't get any errors. I was able to run this same program with Visual, however whenever I run the program with Xcode and input a name, I get this,

Code:

test(2019) malloc: *** error for object 0x100006280: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

I just can't figure out how to resolve this. I tried messing around with the breakpoint button in the command window, but nothing seems to work. This is the only thing that seems to be blocking me from making a trouble-free move from Visual to Xcode, and any help would be greatly appreciated!

If you compile on the command line with those macros set you get the same error. Probably somewhere in your xcode environment those are getting set. I'm not xcode expert, but perhaps they get set automagically when compiling debug? There must be someway to see the actual compile command that xcode is generating.

BTW, I think it's just the GLIBCXX_DEBUG macro that is causing the problem. No mac in front of me so I can't test that.

Looks like for "Configuration" you have "All Configurations" selected. Try to change to "Debug".

Also, from the terminal, with your code in a file called "helloYou.cpp" in the current directory:
make helloYou
./helloYou

That's about 1 minute, tops. This XCode issue has been plaguing you for nearly 24 hours. For a program with about a dozen lines, that's too much. Visual C++ and XCode are both too much. Not just for this project, but probably the whole course you're taking.

I'm not aware of any, but then again I'm not too experienced. I typically use vi or emacs to make fast adjustments. [edit: there is Xemacs, but that is pretty much a compile-it-yourself affair for Macs]

I am having the exact same issue as the original post in this thread. Any time I use the command cin for a character or string (anything other than integers or doubles) I get an error message. Everything is declared properly and I have tried using getline commands.

It seems as if the person with this problem was able to solve it by changing Configurations from "all" to just "debug" but that is not solving my issue. I've also looked to undefine the macros _GLIBCXX_DEBUG=1 and _GLIBCXX_DEBUG_PEDANTIC=1 but can't find them - and I don't even know what they are!

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.