7

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

Adam
  • 3,675
  • 8
  • 45
  • 77

1 Answers1

9

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
  • 97,545
  • 26
  • 194
  • 236
  • 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 Sep 20 '10 at 17:12
  • 1
    @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 Sep 20 '10 at 17:36
  • Sadly, this information is 11 years old now. The latest Eclipse menu tree is different. I've looked all through it and cannot find a setting for this. – lurker Jun 15 '21 at 20:51