Skip to main content
William F
Associate
October 5, 2023
Solved

When I use c++, and I modify .iot file, it doesn't generate the code anymore

To use cpp, I create the project in cpp and then I modify the name of main.c in main.cpp. This work pretty well, but when I try to update the configuration by ioc file, the code stay the same. It seems like I have to change to main.c before update to be fine. Do it exists a more easy way without modify the main extension everytime? Ty

    This topic has been closed for replies.
    TDK
    TDKBest answer
    October 5, 2023

    CubeMX doesn't generate main.cpp. You can put your C++ code in a separate file instead, and call that from main.c. Or you can rename main.c every time. Those are your options.

     

    "If you feel a post has answered your question, please click ""Accept as Solution""."

    2 replies

    TDK
    TDKBest answer
    October 5, 2023

    CubeMX doesn't generate main.cpp. You can put your C++ code in a separate file instead, and call that from main.c. Or you can rename main.c every time. Those are your options.

     

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Pavel A.
    October 5, 2023

    Patient: - Doctor, when I do this, it pains!

    Doctor: - Don't do this.