cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding files from build not working

aroni525
Associate II

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

17 REPLIES 17

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.

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.

"main.c" -> execlude from all builds (as in older versions too)

"main.cpp" -> rename to "main+.cpp" (for example)

then it should work.

Yes it works! Thank you so much :smiling_face_with_smiling_eyes:

But just to understand why we are changing the name of main.cpp?

Sorry but I don't know the answer. It's just a workaround to bypass the bug.

rclar.6
Senior

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!

however after dropping the IDE and restarting it, excluding the linux stuff again the same way... it now works!