C++ Support in STM32CubeIde - class symbol not accepted
Hello All,
I made a C/C++ project with STM32CubeIde version 1.1.0. It works fine.
Then I added a C++ class by a cpp and hpp file. And tried to make an instance of the class in the main.c file. The compiler does not recognize "class" symbol in my hpp file. How to solve this?
Is there an coding example?
Thanks and regards,
Jens
arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DDEBUG -DSTM32F429xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Drivers/CMSIS/Include -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Core/Inc -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/main.o"
In file included from ../Core/Src/main.c:25:0:
../Core/Src/CFlashLed.hpp:21:1: error: unknown type name 'class'
class CFlashLed
^~~~~
../Core/Src/CFlashLed.hpp:22:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
