[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.cdt] Re: Adding a Preprocessor Definition

On 2009-07-21 18:53:49 -0400, fstanley@xxxxxxxxxxxxx (FStanley ) said:

Hello,

I thought I was able to add a "symbol" or definition to the project properties so that if I have something like:

#ifdef FOO_DEFINED
	#include <somefile.h>
#endif

all the code above would be active and indexed. But after adding the define in several locations the code is still marked as inactive.

This is absolutely possible. I use it all the time. When you say you are setting the properties, where exactly are you modifying?


You should be at Project->Properties and select C/C++ Build->Settings. Find under Tool settings, the preprocessor -D options. Add your FOO_DEFINED here. This will add -DFOO_DEFINED to your build script.

Or you could just add #define FOO_DEFINED to some include file and include that file in main.cpp when you need it.

----
Forrest Stanley
Project Engineer
NetBurner, Inc
NBEclipse - Build a network enabled embedded device in one day with an Eclipse interface!

Probably should have mentioned this was with a Makefile based project. I'll give this a try later today. Thanks for the sanity check.


Mike Jackson