Preprocessor include macros don't work

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

Preprocessor include macros don't work

Jump to solution
1,172 Views
laszlomonda
Contributor V

Hi there,

 

I'd like to use the preprocessor include macros feature of KDS to be able to build different firmware images on a per build profile basis for the various versions of our prototypes. Please see the following screenshot:

 

173367_173367.pngScreenshot from 2016-12-23 04-02-05.png

 

For some reason this doesn't work because:

  1. The exact same firmware image gets built as without the macro.
  2. In source code code editor the PROTOTYPE_VERSION_7 macro section gets grayed out instead of the else clause.

 

I'd be really grateful if someone could help me.

 

Thanks in advance!

 

- Laci

Labels (1)
0 Kudos
Reply
1 Solution
727 Views
BlackNight
NXP Employee
NXP Employee

Hi Laci,

add your preprocessor symbols under the -D compiler (C, C++, assembler):

pastedImage_1.png

The other thing to know is: Eclipse uses the Indexer data base to gray out the sources. Depending on your project, I recommend you disable heuristics and rebuild the index, see Fixing the Eclipse Index | MCU on Eclipse 

I hope this helps,

Erich

View solution in original post

0 Kudos
Reply
3 Replies
727 Views
laszlomonda
Contributor V

Hi Erich, and Jennie,

Thank you so much for your help! Erich's instructions totally solved my problem.

Now I have only one question left: What is the preprocessor include macros feature of KDS supposed to do? It seems to me that it doesn't work.

Have a nice day,

Laci

0 Kudos
Reply
727 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Laci,

In addition,  you can refer this article section2.1 with demo code:

How to support multiple targets in CodeWarrior(Classic, Eclipse)/KDS 

I referred Erich's article when writing this section
https://mcuoneclipse.com/2012/03/20/fixing-the-eclipse-index/

Hope this helps!


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
728 Views
BlackNight
NXP Employee
NXP Employee

Hi Laci,

add your preprocessor symbols under the -D compiler (C, C++, assembler):

pastedImage_1.png

The other thing to know is: Eclipse uses the Indexer data base to gray out the sources. Depending on your project, I recommend you disable heuristics and rebuild the index, see Fixing the Eclipse Index | MCU on Eclipse 

I hope this helps,

Erich

0 Kudos
Reply