Reputation: 5959
I am using gfortran to compile FORTRAN 77 and would like to have DEBUG build options by using the preprocessor directive #ifdef. However, when I use them I get compile time warnings "Illegal preprocessor directive". Is it possible to have this functionality without deviating from the standard toolchain?
Upvotes: 0
Views: 4729
Reputation: 119
I fixed this issue by adding -xf77-cpp-input
to my command-line options to gfortran
, i.e.:
$ gfortran -xf77-cpp-input -c -g -DDEBUG fortfile.f
Upvotes: 5
Reputation: 5959
The c preprocessor can be used on the FORTRAN code for this purpose.
http://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-Options.html
Upvotes: 2