We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm trying to use C++ strings with emWin on an MCB1800 development board and am hitting problems when I attempt to allocate a value to the string.
I've reduced the code to the following:
#include <string> #include "GUI.h" int main (void) { GUI_Init(); GUI_SetBkColor(GUI_RED); GUI_Clear(); //static char buf [400]; // happy //char const *fred = "Hello world"; // happy //std::string s1; // happy std::string s2("Hello world"); // fail while (1) { GUI_Exec(); } }
If I attempt to allocate "Hello world" to s2 the system locks at =SystemInit in the Reset_Handler. If I uncomment one of the other lines the system starts successfully and I see the red screen.
Does anybody know what is causing this and how I can work around it?
Thanks in advance.