stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: ios_base::Init::Init ();
Date Wed, 07 May 2008 19:07:07 GMT
 

>pegasus2000 wrote:
>
>I've compiled with success the first version
>of NanoCPP (STDCXX for Nanodesktop). 
>
>So, when I enter this program:
>
>#include <nanodesktop.h>
>
>#include <iostream>
>
>int main()
>{
>    ndInitSystem ();
>    using namespace std;
>    
>    ios_base::Init::Init ();
>    
>    cout << "Hello World!";
>    return 0;
>}
> 
>I obtain the "Hello world" on the
>screen of the PSP. 
>
>But, if I remove the string:
>
>ios_base::Init::Init ();
>
>the system crashes at startup. Is it
>a normal behaviour or there's some
>option in config.h that I must enable
>in order to autoinit any object ?

ios_base::Init::Init() is the constructor for the type ios_base::Init.
You probably shouldn't be calling it directly, I'm almost surprised that
it compiles. At the very least you should be using it by creating an
object of that type so that the destructor is called.

You should not normally have to do this. It should be done automatically
for you at dynamic initialization time.

>From the looks of it, I'd guess that _RWSTD_NO_STATIC_IOSTREAM_INIT is
getting defined somewhere. I peeked at my config.h and the config tests
and I don't see that macro anywhere. Do you define this macro somewhere?

Travis

>
>Thanks
>Filippo Battaglia
>

Mime
View raw message