# FreeRTOS with C++

**URL:** <https://forums.freertos.org/t/freertos-with-c/1178>\
**Category:** Kernel\
**Created:** [January 4, 2014, 11:33am UTC](https://forums.freertos.org/t/freertos-with-c/1178 "2014-01-04T11:33:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 4, 2014, 11:33am UTC](https://forums.freertos.org/t/freertos-with-c/1178/1 "2014-01-04T11:33:35Z")

</div>

**[vicharshunya](https://sourceforge.net/u/vicharshunya/)** wrote on [Saturday, January 04, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/34d13470/#c581):

Hi,

I am trying to use C++ application with FreeRTOS.  
I come to know about this post :- [https://sourceforge.net/p/freertos/discussion/382005/thread/5d5201c0](https://sourceforge.net/p/freertos/discussion/382005/thread/5d5201c0) but I am not sure how and where to add this TaskCPP.h file.

Right now I have very simple main.cpp file something like this.

int main(void)  
{  
//Set priority bits to preempt priority  
NVIC\_PriorityGroupConfig(NVIC\_PriorityGroup\_4);  
for( ;; );  
return 0;  
}

And this gives me an error :-  
/usr/bin/…/lib/gcc/arm-none-eabi/4.7.4/…/…/…/…/arm-none-eabi/bin/ld: error: STM32F4\_FreeRTOS.axf uses VFP register arguments, /usr/bin/…/lib/gcc/arm-none-eabi/4.7.4/libgcc.a(unwind-arm.o) does not

/usr/bin/…/lib/gcc/arm-none-eabi/4.7.4/…/…/…/…/arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/bin/…/lib/gcc/arm-none-eabi/4.7.4/libgcc.a(unwind-arm.o)

I am not sure what is wrong with settings.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [January 4, 2014, 7:41pm UTC](https://forums.freertos.org/t/freertos-with-c/1178/2 "2014-01-04T19:41:52Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Saturday, January 04, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/34d13470/#1cab):

TaskCPP.h would be included by any file that wants to create a Task via the FreeRTOS wrapper classes.

While I am not familiar with this specific toolset, it looks like there is a configuration error between how you are compiling the file and the library you are linking it to.

The path it is quoting to the linker makes me think something is set up strange (with two different sets of path backtracking).

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 9, 2014, 9:44am UTC](https://forums.freertos.org/t/freertos-with-c/1178/3 "2014-01-09T09:44:49Z")

</div>

**[beginend1](https://sourceforge.net/u/beginend1/)** wrote on [Thursday, January 09, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/34d13470/#e27c):

Most likely you are linking with library that uses different floating point calling convention. Check which calling convention is used in library or play with adding/removing “-mfloat-abi=[soft|softfp|hard]” and/or “-mfpu=fpv4-sp-d16” to/from compilation options.
