How to specify a preprocessor directive in eclipse?
Asked Answered
B

1

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

Brandt answered 19/9, 2010 at 19:29 Comment(0)
R
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.

Romanticist answered 19/9, 2010 at 19:45 Comment(3)
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?Brandt
@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 according to the configuration should do it.Romanticist
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.Maleeny

© 2022 - 2024 — McMap. All rights reserved.