Skip to main content
diego ambroggi
Associate III
October 22, 2018
Question

Atollic C++ implementation

  • October 22, 2018
  • 14 replies
  • 2720 views

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 

    This topic has been closed for replies.

    14 replies

    Andrew Neil
    Super User
    October 23, 2018

    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 ... ?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    diego ambroggi
    Associate III
    October 23, 2018

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

    Andrew Neil
    Super User
    October 23, 2018

    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 ...

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Cedric LECOUTRE
    ST Employee
    November 5, 2018

    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