cancel
Showing results for 
Search instead for 
Did you mean: 

Added File to STM32CubeIde project; appears to compile, but doesn't

paulrbryson
Associate III

I added a c source file to an existing folder in my project and it shows in the project explorer.

When I build the project or build the individual file it appears to compile (in the console). But references to functions in the file come back as undefined. Also if I introduce deliberate errors in the source file; it compiles without errors.

What could be going on?

3 REPLIES 3
paulrbryson
Associate III

I found the problem.

The editor was not properly indicating the state of an "#ifdef", i.e. it did not gray out the code even though the value was not defined.

I have come to rely heavily on this feature.

I guess the question now is:

"Why doesn't the editor gray out the code properly?"

Check the related Eclipse editor parameters. These parameters are reset when a new workspace is created.

I am not sure where to look for those parameters - but it only fails on this one new file. In all of the other files in my project the editor grays out #ifdef'ed code.

Does each source file somehow have separate editor settings?