2020-02-22 05:53 PM
When I select the following options from the Project Explorer using "New->STM32 Project":
One would expect that the project would be set up as a C++ project, especially considering that the option is presented to the user.
However this is not the case.
Choosing C or C++ produces exactly the same main.c and other files.
This option seems to serve no purpose.
Is there anything else I need to do to have the entire project work as a C++ project, or do I have to continue using the usual 'extern "C"' work-arounds that I'm currently using?
2020-02-23 07:40 AM
A C++ project has C++ compiler build settings but does not generate C++ files. You can add your own C++ files and call your C++ functions from a user code section in main() in main.c using C++ extern C. This separates all generated code from your C++ code and works well for me, e.g. for using ROS (rosserial) code.