Skip to main content

Posts

Showing posts with the label iostream

C++ - inheriting ostream crashes on android but not windows

I have implemented a simple ostream and streambuf class. For some reason, it crashes when I try to instantiate my AndroidLogOStream object. Note: I have stlport_static in my Application.mk class AndroidLogStreamBuf : public std::streambuf { public: inline AndroidLogStreamBuf() : std::streambuf() { //std::cout << "asdfg"; } inline ~AndroidLogStreamBuf() { } }; class AndroidLogOStream : public std::ostream { public: inline AndroidLogOStream() : std::ostream(&mBuf) { } inline ~AndroidLogOStream() { } private: AndroidLogStreamBuf mBuf; }; It's barebones, and it runs fine on windows. It compiles fine on android, but it crashes for some reason. The last line it tries to execute is in _streambuf.c:46: template <class _CharT, class _Traits> locale basic_streambuf<_CharT, _Traits>::pubimbue(const locale&