Rafael Dazcal
Rafael Dazcal

Reputation: 355

Correctly Highlighting Inactive code in Eclipse

I`m using Eclipse IDE for development with an external compiler.

There is a nice feature where the IDE highlights inactive code that is inside a #ifdef condition.

However, some defines are established at compile time, and the IDE is unaware of them (since I`m using an external compiler).

In VisuaStudio, I would add these compile-time definitions in the project definitions and that would fix my problem.

In Eclipse, I see I can do the same under Project Properties->C/C++ Build->Build Variables.

However this seems not to be working for me.

Can anyone tell if I am missing some steps?

Thanks a lot

Upvotes: 0

Views: 1297

Answers (1)

Rafael Dazcal
Rafael Dazcal

Reputation: 355

Ok, I found the way to do it.

In my Visual Studio logic, I was changing the Project->Properties->C/C++ Build->Build Variables

But my guess this affects only the build process.

To actually get Eclipse to use the compile-time defs when highlighting inactive code I have to go to:

Project->Properties->C/C++ General->Paths and Symbols->Symbols->GNU C

Followed by a refresh (F5) on the project

That solved my problem

Upvotes: 1

Related Questions