2021-09-05 11:43 AM
Hi,
since I have upgraded to 1.7.0 a few of my C++ projects stopped working. When I code in C++ I always create main.cpp file and I exclude from all builds main.c file (I don't delete this file as it is always generated by CubeMX). This has been working for a long time.
But now it crashes. It still try to compile main.c file. What's more, if I delete main.c file, linker tells me that it cannot find main symbol. For some reason compiler doesn't compile my main.cpp file. I have C++ nature set up and all other .cpp files are compiled, but not the main.cpp...
Everything was working until I upgraded to a new STM32CubeIDE version. I check on 3 computers, everywhere it stopped working.
Is there any know bug related to this problem?
Best,
Arek
2022-01-30 11:38 PM
The "main.c" will always be regenerated by the IOC-File, but you can set it to exclude from all builds.
You have to rename the "main.cpp" to another name,
You can clean your project and rebuild the index. After this it should build correct.
2022-01-31 06:00 AM
Thank you for your fast reply! Yes, when I delete the file, its debugging correct, but I have to always delete main after generating the code. On previous version of my stmcubeide I could easily exclude from build but now it seems like it's not working.
2022-01-31 06:07 AM
"main.c" -> execlude from all builds (as in older versions too)
"main.cpp" -> rename to "main+.cpp" (for example)
then it should work.
2022-01-31 07:51 AM
Yes it works! Thank you so much :smiling_face_with_smiling_eyes:
2022-01-31 05:17 PM
But just to understand why we are changing the name of main.cpp?
2022-01-31 11:47 PM
Sorry but I don't know the answer. It's just a workaround to bypass the bug.
2023-04-30 11:45 AM
Having this exact problem now on 1.10.1. Funny thing is is worked yesterday!
I have a directory that is compiled under linux to set up a load of fixed point stuff. It used not to try to compile it. Now it does and fails!
2023-04-30 01:28 PM
however after dropping the IDE and restarting it, excluding the linux stuff again the same way... it now works!