Skip to main content
paulrbryson
Associate III
October 16, 2022
Question

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

  • October 16, 2022
  • 1 reply
  • 2272 views

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?

This topic has been closed for replies.

1 reply

paulrbryson
Associate III
October 17, 2022

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?"

Pavel A.
Super User
October 17, 2022

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

paulrbryson
Associate III
October 17, 2022

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?