Using C++ with the STM32F4 Discovery causes linker errors, what am I doing wrong?
I've created a project using the **platformio init --board=disco_f407vg** command, and then proceeded to write a main.cpp. Everything seemed to work fine at first but when I try to use **new** or **delete** I get linker errors. Specifically I have a line **int \\* testInt = new int;** which then causes **main.cpp:12: undefined reference to `operator new(unsigned int)'** (where line 12 is the line containing the new call).

I'm guessing I still have to add some setting to the platform.ini to configure it for full C++ support, but I can't find anything about such a setting in the documentation. What am I missing?

Thanks for the help (also thanks for building this software, I don't think I've ever had a toolchain and bsp install this quickly and easily!)

diff --git a/platformio/builder/scripts/ststm32.py b/platformio/builder/scripts/ststm32.py
index 0855457d..c1622028 100644
--- a/platformio/builder/scripts/ststm32.py
+++ b/platformio/builder/scripts/ststm32.py
@@ -53,6 +53,8 @@ env.Append(
         "${BOARD_OPTIONS['build']['variant'].upper()}"
     ],
 
+    LIBS=["stdc++", "nosys"],
+
     LINKFLAGS=[
         "-nostartfiles",
         "-nostdlib"
['platformio/builder/scripts/ststm32.py']