2019-09-23 04:50 AM
Hello,
I am migrating from Arduino to CubeIDE looking to have better IDE and better performance code. Migration was rather challenging but managed to go ahead. Still there is one new issue I have.
I created a C++ project using CubeMX but I get this error and others related to classes. Even I create C++ project the main file still has .C extention. To resolve I tried:
Still the error remains.
I expect is a newbie question, I am sorry. Could anyone help?
Thanks
2020-09-14 07:13 AM
This happens when you include an header with a class from a C- file.
C cannot call or use Classes.
When you write your own intermidiate mainCpp-funciton the main.c can call this mainCPP-function form a mainCpp.cpp. The mainCpp.h may not contain any classes.
Then you can include and use all Class-Headers from mainCpp.cpp