06-01-2009 06:30 PM
I am trying to get preprocessing in the Eclipse plugin to work. I would like to have one code base and be able to compile against the component pack 4.5 and 4.6. In 4.6 you can do something like this:
where title is a LabelField in this case. BackgroundFactory doesn't exist in 4.5 and hence I would like to do something like this
//do nothing for now
According to my eclipse/configuration/config.ini I have the following line it it:
But still, even after a clean build, Eclipse still says it cannot find BackgroundFactory when I try to compile it against the 4.5 component pack. I have not specified VERSION_4_6_HIGHER in my 'preprocessor defines' in my project settings so hence it shouldn't compile the one line and Eclipse shouldn't say it can't find BackgroundFactory.
Am I missing anything here? Has anybody made any successful expierence with preprocessor and the Eclipse Plugin?
06-02-2009 03:29 PM
//#preprocess must be the first line in the file.
Second, to avoid Eclipse complaints, you could comment out the line like so:
06-02-2009 05:18 PM
06-02-2009 06:05 PM
That's really odd. I have the //#preprocess on the first line too and as soon as I add this:
Eclipse will complain. Are you using the 'Build automatically' option or do you manual builds?
10-16-2009 04:59 PM
Hopefully you got this sorted out, somehow I missed your message. I use the build automatically option. I have run into trouble when I've accidentally ended up with spaces between the // and the #, which happens because of my tendency to use the auto-formatting to clean up indents and such when they get wacky.
12-17-2010 12:14 PM - edited 12-17-2010 12:15 PM
Thread from the Dead, I know, but I experience similar issues with preprocessor commands (eclipse 3.5/bb plugin1.1), with the proviso that imports behave as expected in the //#ifdef //endif block -- no commenting out necessary
-- thanks to skicson for suggesting the obvious that I missed
It's a simple task, usually, and this workaround is fine, but this kind of says "I don't know the guts of my rig" if you know what I mean...
if preprocessor ifdef/endif blocks (in methods, etc) are not commented out eclipse whines... Are we missing a simple global setting in eclipse/plugin?
anyone from RIM out there?