Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

C Style Preprocessor

moah
Beginner
357 Views
Hello.

I'm glad to find this site.
I counld'n find a solution for days.

I really hope you can give me a solution.

I want to use C Style Preprocessor.
Cause as I know VF 6.6B can support that.

I make a Header file.
That file constists like these.
#define a 100
#define b 200

So I inlude that header file.
#include "header.h"
But when I compiled it, I saw # bad processor warning.
And then I can't complete compile.

In documention, use /fpp option.
But I can't exactly know how to do it.

Please tell me.. I need your help...

thank you.
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
357 Views
See this recent thread.

If all that header #defines are constants, I'f recommend using standard Fortran PARAMETER attribute instead of #define (and possibly INCLUDE statement (not #include)). If you really need macros with arguments, only then IMO #define has its merits.

Jugoslav
0 Kudos
Lorri_M_Intel
Employee
357 Views
By default, the Fortran preprocessor doesn't do macro substitution.

It's a little klunky to override that default, but still pretty easy.

If you are using the command line, df /fpp:"/m"
or, if you are using Developer Studio, go to Project-
Settings-Fortran, then in the Project Options box in the lower right corner, modify the /fpp to /fpp:"/m"

- Lorri

0 Kudos
Reply