Preprocessor include macros don't work

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Preprocessor include macros don't work

ソリューションへジャンプ
1,173件の閲覧回数
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

ラベル(1)
0 件の賞賛
返信
1 解決策
728件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
728件の閲覧回数
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 件の賞賛
返信
728件の閲覧回数
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 件の賞賛
返信
729件の閲覧回数
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 件の賞賛
返信