tags:

views:

140

answers:

2

The problem I'm seeing is that under preferences, C/C++ Defined symbols for different Configurations/targets aren't showing up in the code coloring.

When I change the active build configuration in the project menu, I would expect the editor & code coloring to pick up the symbols from the project settings, but it only seems to be picking up the symbols for one of the targets.

Is there any way to have the code coloring for ifdef'ed code follow the active build configuration?

A: 

Try playing around with your project's Discovery Options. (Right-click on the project, choose Properties, go under C/C++ Build, and choose Discovery Options.)

You may need to rebuild your project after changing its build configuration in order for Eclipse to rerun its discovery, or you may need to change the discovery options for each configuration to cause them to generate different results. (Sorry, this isn't an area of the CDT that I've played much with.)

Josh Kelley
Both 'automate discovery of paths and symbols' and 'Report path detection problems' are selected, and the Discovery profiles scope is set to 'Per Language'. These were the default settings.Rebuilding after changing the active build doesn't seem to make any difference in the code coloring for the ifdef'ed out sections.
Guy
A: 

I solved this problem on my system by setting 'Window->Preferences->C/C++->Indexer->Use active build configuration'