Undefined error from Compiler, but not from IDE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined error from Compiler, but not from IDE

Jump to solution
2,119 Views
marcbunyard
Contributor IV

I'm getting a compiler error where the compiler says that it has an undefined variable, yet the IDE is able to find it through "Open Declaration".  All of the include paths seem to be intact, but the compiler errors on the same variable.

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
1,856 Views
BlackNight
NXP Employee
NXP Employee

The error only disappeared because the preprocess 'compile' was sucessful. About the output console: I have it the preprocessor listing in a new window/source file. I'm using gcc.

View solution in original post

0 Kudos
Reply
7 Replies
1,856 Views
BlackNight
NXP Employee
NXP Employee

Could you post the exact error message? Which compiler/target?

I recommend that you generate a preprocesing listing: I guess there is something wrong with your includes, or with the defines.

The fact that the IDE does not find the declaration too really could mean that your includes are not correct.

I hope this helps.

0 Kudos
Reply
1,856 Views
marcbunyard
Contributor IV

The IDE DOES find the declaration.  That's what's confusing.  Here's a screen capture of the error after the compile:

UndefinedError.png

I'm  trying to figure out how to get the pre-processor listing (still new to Code Warrior).

Thank you.

0 Kudos
Reply
1,856 Views
BlackNight
NXP Employee
NXP Employee

ah, sorry, I thougth the IDE was not able to find it.

Preprocessor listing: you should be able to right click on the source file, and the context menu should offer you that.

Maybe the order of includes is the problem?

0 Kudos
Reply
1,856 Views
marcbunyard
Contributor IV

Interesting.  I right clicked on preprocess, it ran the preprocessor, and the errors were removed!  So I ran the build, and they're back!?  To add another level to the confusion, this project compiles, but won't link, under RAM, but not FLASH (hvac_wifi).  I haven't changed the include file order from what it was when shipped as a Freescale example.  The hvac_wifi example appears to be written for the K60M100, and I am building it for the K60M120.  The startup code for the M100 would not work for the M120.  It hung on the PLL setup.

When I ran the preprocessor, the listing was output on the console.  After doing the build, it stopped outputing it on the console. ???

0 Kudos
Reply
1,857 Views
BlackNight
NXP Employee
NXP Employee

The error only disappeared because the preprocess 'compile' was sucessful. About the output console: I have it the preprocessor listing in a new window/source file. I'm using gcc.

0 Kudos
Reply
1,856 Views
marcbunyard
Contributor IV

The preprocessor was a good suggestion.  I clicked on disassembly below it, and got an error I hadn't seen before.  It was a missing include path that kept me from including "verif_user_config.h".  It compiles ... now ... does it run?!?!?

Thank you.

1,856 Views
marcbunyard
Contributor IV

The preprocessor was a good suggestion.  I clicked on disassembly below it, and got an error I hadn't seen before.  It was a missing include path that kept me from including "verif_enabled_config.h".  It compiles ... now ... does it run?!?!?

Thank you.

0 Kudos
Reply