CMSIS: CMSIS RTOS does not compile with option --cpp11
Information in this knowledgebase article applies to:
My MDK-ARM project uses C++11 code.
Now I want to include the CMSIS-RTOS interface for ARM® Cortex®-M processor-based devices.
When next compiling my project with C++11 enabled (--cpp11 option) the following error is generated:
error: #390: function "main" may not be called or have its address taken
According to C++ (03 or 11) it is not allowed to take the address of "main". This is enforced by the compiler and produces an error.
However, CMSIS RTOS needs to know the address of "main" in order to start it as the first thread.
So Keil's RTX_Conf_CM.c must not be compiled as C++.
Just right-click over RTX_Conf_CM.c and set the option --c99, as demonstrated by this screenshot:
Last Reviewed: Monday, September 12, 2016
of your data.