Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Porting some C++ code to FreeRTOS

Posted by Leonidos mak on November 26, 2008
Would you help me with advice? I'm very new in ARM and FreeRTOS...

I need to port some C++ code to ARM with FreeRTOS.
There is 2 ways: rewrite code using only C, or make some changes and try to use C++.

It would be very nice if someone tells me how to enable C++ support with Eclipse+arm-none-eabi-gcc compiler and FreeRTOS. When I try to enable it I get many error message.... Would you give me some instructions and correct make_file.

Or its better to rewrite all in C? =)


P.S. I found this http://www.mediafire.com/?mmnth9cw99n. There is c++ example in it, but I can't build it. Many errors ).

RE: Porting some C++ code to FreeRTOS

Posted by Dave on November 26, 2008
Search this forum for C++. There are some posts with information on how to do this.

Basically, compiler the FreeRTOS code as C and your own code as C++ (the FreeRTOS headers are written for this), or remove the data hiding from the FreeRTOS code and compile it all as C++.

RE: Porting some C++ code to FreeRTOS

Posted by Richard Damon on November 27, 2008
While I don't use that exact combination, I do use FreeRTOS in a C++ project. The key is that the FreeRTOS files (which are of type .c) need to be compiled a "C" code, not C++ code. The compiler should have an option switch to make use the file extension to determine the compiling mode.

RE: Porting some C++ code to FreeRTOS

Posted by Leonidos mak on November 27, 2008
Thanks for your help.

I think I should go and learn about writing makefiles. =)
If anybody have such makefile it would be nice to see it.

RE: Porting some C++ code to FreeRTOS

Posted by ravaz on November 27, 2008

you can take a look on the following post, maybe it can help you:

http://www.luminarymicro.com/component/option,com_joomlaboard/Itemid,/func,view/catid,5/id,2306/ #2306

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner