Monday, 1 March 2021

Re: [gccsdk] std::stringstream with GCCSDK

Hi Lee,

Thanks for the message! I couldn't get the stringstream to work at all, and when I searched up the errors somebody mentioned that C++11 support was incomplete in 4.7? 

So I then decided to try GCC8 in GCCSDK. This meant I couldn't do my build/debug cycle in RPCEmu as it needs VFP, but I did get it to compile once I had altered all references to wchar_t (which is specifically disabled I noticed in the GCCSDK build). It actually runs pretty well on RISC OS itself but with one huge caveat. If I throw an exception, in certain cases it crashes out with a library error. If I throw an exception of type T and catch *exactly* type T then it works, but if I force the exception to be caught in a parent function it crashes. I've tried compiling with and without optimisations but with no luck.


Searching brought up that link, which suggests something very similar. ARM, armeabi and C++.

Any ideas? Everything else is working that I can see!

Thanks,
Daryl.

On Sun, 28 Feb 2021 at 11:46, Lee Noar <lee.noar@sky.com> wrote:
On 21/02/2021 23:56, Daryl Dudey wrote:
> I'm writing a fairly big C++ BASIC style language for Windows & RISC OS and I'm trying to cross-compile on Windows and I can't get the std::stringstream to not give errors. I had problems with ostream before and switched to use regular C I/O functions to get around it.
>
> I get various errors including deleted functions errors. I can post the output if useful.
>
> If I replace it with just std::string or fprintf then it all works, but a lot of the code is in 3rd party library stuff I daren't risk changing.
>
> Is there anything I can try or do?
>
> Thanks,
> Daryl.

Hi Daryl,

Can you post a reduced example that show the errors that you are seeing?

I'm surprised that you had trouble with ostream as that is paired up
with the compiler and so its features are matched to what the compiler
is capable of (rather than 3rd party libraries which may have higher
expectations from the compiler).

Deleted function errors usually indicate that you're trying to use an
object in a way that isn't allowed, for example, trying to copy an
object when the copy constructor has been deleted. The nature of C++
means you can be copying an object without even realising it, for
example, by passing an object to a function by value instead of by
reference.

Lee.

No comments:

Post a Comment