Re: C++ standard libs errors
Re: C++ standard libs errors
- Subject: Re: C++ standard libs errors
- From: Chris Espinosa <email@hidden>
- Date: Sun, 7 Feb 2010 14:15:27 -0800
On Feb 7, 2010, at 2:07 PM, Krassimir Simeonov wrote:
> Hi,
>
> When I run the following program on Win and Linux it produces output of
> 22
>
> #include <iostream>
>
> class MyStreamBuf : public std::streambuf
> {
> protected:
> int overflow ( int c = EOF )
> {
> std::cout << static_cast<char>(c);
> return c;
> }
> };
>
> int main( int argc, char** argv )
> {
> std::cout << 2; // ok
> MyStreamBuf myStreamBuf;
> std::ostream myStream(&myStreamBuf);
> myStream << 2; // exception
> }
>
> When I compile and run it in XCode (3.2.1 - MacOS X 10.6) it throws an exception when I try to call the operator <<(int).
>
> I traced this to the point where myStream._M_num_put is NULL.
>
> Does anyone know how to work around this issue?
In your Project (or Target) build settings, in the Search bubble enter
GLIBCXX_DEBUG
If you find it defined to 1 in Preprocessor Macros or Other C Flags, delete the definition. Same for _GLIBCXX_DEBUG_PEDANTIC.
Chris _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden