Keil Logo

CMSIS: CMSIS RTOS does not compile with option --cpp11


Information in this knowledgebase article applies to:

  • MDK-ARM V5
  • CMSIS RTOS

SYMPTOM

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

CAUSE

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++.

RESOLUTION

Just right-click over RTX_Conf_CM.c and set the option --c99, as demonstrated by this screenshot:

MORE INFORMATION

SEE ALSO

Last Reviewed: Monday, September 12, 2016


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.