tags:

views:

29

answers:

1

How are preprocessor directives specified in eclipse for different configurations? For instance if I have multiple mains that should be run in different configurations and specify

#ifdef Problem1
//main func
#endif /*Problem1*/

Note that this is with managed makefiles

+1  A: 

The documentation points to "C/C++ Project Properties""Paths and Symbols""Symbols".

However, usually it is better to use different source files for different configurations/architectures/... instead of extensive preprocessor usage.

Georg Fritzsche
I was planning on using different source files, but I cannot have multiple mains in the build. Is there a better way to specify which main function or file is used?
Adam
@Adam: I was thinking of only including specific source files with different mains in the build depending on the configuration. I don't have Eclipse here now, but "exclude resource from build" [here](http://help.eclipse.org/galileo/topic/org.eclipse.cdt.doc.user/reference/cdt_u_fileprop_toolsettings.htm) according to the configuration should do it.
Georg Fritzsche