This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems using std:string

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.