Symbol defined or not, that’s the question


I just ran into this problem: I know I have this file in my project, but still the linker complains that it cannot find the symbols: “Symbol X is undefined”? It must be something obvious, but somehow I cannot see it?

Symbol Undefined Linker Error Message

Symbol Undefined Linker Error Message

I know all these things are in my Events.c file, and it is part of my project:

Events.c in my project

Events.c in my project

The linker does not have Events_c.obj file listed in the Console view. The console at least tells me what the linker is using:

"C:/Freescale/CW MCU v10.2/MCU/prog/linker" -ArgFile"SRB.args" -O"SRB.abs"
"C:/Users/Erich Styger/Data/HTA/CW/wsp_Intro/SRB_Ref/Project_Settings/Linker_Files/ProcessorExpert.prm"
Command Line: '-ArgFile"SRB.args" -O"SRB.abs"'
....

So the *.args file has the arguments. The external .args file helps the linker to deal with the host operating system command line length limitiation. Inspectinig the .args file indeed does not have Events_c.obj listed.

So indeed, the file is not part of my build. Maybe I screwed up something? Yes, I was working on build configurations, have added configurations and removed them again. Maybe this caused the problem? And yes, indeed, I noticed the tiny icon decorator change for my file, indicating that my file indeed has special settings:

Using the ‘Reset to Default…’ is removing the settings:

Reset to Default...

Reset to Default...

Now I see as well the cause of the troubles: the file is excluded from the build:

File excluded from build

File excluded from build

Ah, OK! I did not pay attention to the icon decorator. Now the fix is easy. The file is part of my project, but not part of my build :-(. Although including means you have to select ‘Exclude‘ again:

Exclude from build

Exclude from build

This gives me the following dialog, where I need to un-check it to have it back included in the build:

Exclude from build dialog

Exclude from build dialog

Another ways is to use the ‘Properties’ menu on that file:

File Properties

File Properties

Note: In case you exclude the Batch Burner File (burner. bbl) from the build, then the S19 file will not be generated. So if you want that S19 file, and it is not built, you might check if you have excluded the burner.bbl from the build configuration.

Happy Excluding & Including 🙂

Advertisements

One thought on “Symbol defined or not, that’s the question

  1. Pingback: Icon and Label Decorators in Eclipse | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s