c++ stream init and c library initialization

87 Views Asked by At

I've written a C library for AmigaOS4. Everything is working correctly except when I try to use the libc.so and libstdc++.so.
Basically the problem is that libstdc++ calls stream Init (https://en.cppreference.com/w/cpp/io/ios_base/Init) too early. Before libc constructors and so stdin, stdout and stderr are not yet created.
So, when i try to use even a simple example that is using cout I get a DSI (NPE). I didn't found any way to set the c++ Init constructor priority. I've tried also to lower the C lib constructors priority but with no luck. Any hint? Maybe some gcc switch or flag?

0

There are 0 best solutions below