cancel
Showing results for 
Search instead for 
Did you mean: 

C++ in a C project

andrewtholt60
Associate
Posted on November 24, 2016 at 11:58

I am working on a project with the following

NUCLEO-F401RE board

AC6 IDE

A freeRTOS project with, currently, 2 tasks.

I want to add a C++ class, with C wrappers into the project.

I can add the files, with .cpp extensions but the eclipse doesn't compile the files.

I have managed, by a set of fairly elaborate steps to 'hack' something, but I can't believe that there is no simple way to do this.

Any advice appreciated,

2 REPLIES 2
Jeroen3
Senior
Posted on December 07, 2016 at 07:49

You have two options.

- Use a C++ compiler.

- Rename to .c and #if out the C++ lines.

Liviu Ionescu
Associate III
Posted on December 07, 2016 at 09:02

You can take a look at the demo projects at 

https://github.com/micro-os-plus/eclipse-demo-projects

 , for example the F4DISCOVERY one.

All are C++ projects, and all use

http://micro-os-plus.github.io

, a system fully written in C++.