C++ sample?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
rocketdawg
Posts: 6
Joined: Fri Mar 01, 2013 10:34 pm

C++ sample?

Post by rocketdawg »

Is there a c++ example?
One cannot just change the make file to use g++ since many "C" files do not have __cdecl guards/directives.
Do I have to build a kernel library and then link that to my c++ main()?
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: C++ sample?

Post by Giovanni »

Hi,

There are C++ examples in the repository, you should checkout the trunk for the latest C++ code. There is a C++ wrapper for the kernel objects too.

Giovanni
rocketdawg
Posts: 6
Joined: Fri Mar 01, 2013 10:34 pm

Re: C++ sample?

Post by rocketdawg »

thanks,
I'm using the ChibiStudio and built some examples and downloaded to the F4 Discovery.
I see a STM32F103 g++ example.
I'm using a STM32F4 so it should not be hard to figure it out.
I'll look at the repo as well.
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: C++ sample?

Post by Giovanni »

On the repo there is an F4 example, it is not different, a C demo differs from a C++ one just because main.cpp file and the C++ wrapper, try comparing makefiles.

Giovanni
rocketdawg
Posts: 6
Joined: Fri Mar 01, 2013 10:34 pm

Re: C++ sample?

Post by rocketdawg »

I see it.
Great! Thanks
Post Reply