-->
Page 1 of 1

C++ working?

PostPosted: Sat Sep 24, 2016 9:57 am
by SteveBaker
I'm something of a newbie to ESP8266 (although I have bucketloads of embedded processor experience). So to get started, I used a FDTI232 board and grabbed the "blinky" code and got all of that running.

However, if I compile that same example using the g++ compiler instead of gcc - making only the minor code changes needed and using all the same compiler parameters and flags, it doesn't run at all.

Does anyone have C++ running on the ESP8266? Is there some vital library or flag I might be missing?

C++ working!!

PostPosted: Sun Sep 25, 2016 2:59 pm
by SteveBaker
Actually, I got it working! I had to write code for operator new & delete, malloc and free and also an abort function and an empty function for the mysterious __gxx_personality_v0() function that has something to do with exception handling. Various SDK functions that are bound to ROM locations needed 'extern "C"' definitions written for them. To get things smaller to fit in memory, I needed to compile with -fno-enforce-eh-specs -fnothrow-opt -fno-exceptions -fno-rtti - which DEFINITELY breaks exceptions.

However, I now have g++ working with native ESP8266. I'll try to get this together enough to publish it sometime soon.