Compiler directives in Include files don't work

Hi, I can’t seem to be able to use compiler directives such as #ifdef, #else, #endif, etc. in Include files. They work in my main code but not in my Include file (eg. Fred.FI) that I am including with a statement like INCLUDE ‘Fred.FI

Is this some way around this?

Hi Peter,

Try using “#include” instead of “include”. The C “#include” should be processed at same time as the other C preprocessor directives, while if I remember correctly, the Fortran “include” gets copied into the main source after this step.

  • Mat