cancel
Showing results for 
Search instead for 
Did you mean: 

Atollic C++ implementation

diego ambroggi
Associate III

Hello Mr./Ms.

I need to implement some libraries e.g. Arduino or other open source code.

So I tried to import in Atollic a C++ librarie but returns an error when I instance a class.

It's possible to do that or only C moddules are supported?

I generate code using CubeMx tool.

Thanks in advance

Best regards 

14 REPLIES 14
diego ambroggi
Associate III

Hi Andrew

I simply changed main.c in main.cpp but I have a lot of error generated (see attached).

I think is mandatory to change some eclipse settings.

have some tips?

Best regards

Andrew Neil
Evangelist III

I think you need to step back, and reconsider the design - rather than just randomly changing stuff here & there.

The errors you show are Linker errors - so you have got past the C/C++ language issues.

If you created the project as a 'C' project, then it probably has the 'C' startup & runtime support - not C++.

And remember that C++ has name-mangling ...

As I suggested earlier, it's probably best to start with a C++ project, and bring the 'C' bits in - rather than the other way around.

Have you read-up on the standard requirements for mixing C and C++ - "extern 'c'", etc ... ?

diego ambroggi
Associate III

No I don't know standard requirements for mixing C and C++ - "extern 'c'", etc ... :downcast_face_with_sweat:

Andrew Neil
Evangelist III

Well that's clearly something that you need to read-up on and understand first!

As noted, it's not specific to STM32 or ARM or GCC

May well be easiest to do that on a PC - away from the added complications of the embedded world ...

Cedric LECOUTRE
ST Employee

Hi @diego ambroggi​ ,

can you have a look at this thread:

https://forum.atollic.com/viewtopic.php?f=3&t=1522&p=3450&hilit=STM32CubeMX#p3450

I am not sure you did the File > New > Convert to a C/C+ Project step, and also migrating C compiler settings.

Best regards,

Cedric