How to specify a preprocessor directive in eclipse?
How are preprocessor directives specified in eclipse for different configurati开发者_Go百科ons? 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
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.
精彩评论