g77/gcc & #define in FORTRAN

Mumit Khan khan@xraylith.wisc.edu
Thu Sep 30 23:56:00 GMT 1999


In article < 37D7FC05.AE523A72@ca.sandia.gov >,
Habib Najm  <hnnajm@ca.sandia.gov> wrote:
>I am using Red Hat linux 6.0 on a Dell 610 PC/workstation. The installed
>g77 responds to g77 -v with a first line :
>
>   g77 version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (from
>FSF-g77 version 0.5.24-19981002)
>
>I cannot get g77 (which proceeds to use gcc and cpp to process an f77
>file) to interpret #define and other C compiler directives in a
>FORTRAN file. For example, when I try to compile :

[ code snipped ]
>
> > g77 t.f
>t.f:4: undefined or invalid # directive
>t.f: In program `t':
>t.f:6: undefined or invalid # directive
>t.f:8: undefined or invalid # directive
>>
>
>What am I missing ?
>


1. Read the g77 documentation. It may not be ideal documentation, but it
   does have some useful info. You could've gotten the answer to this
   particular question probbably faster than the time it's taking me to 
   write the following ...

2. Name your file .F or use -x f77-cpp-input option.
   
   $ g77 t.F

   or

   $ g77 -x f77-cpp-input t.f

   If you have g77 info docs installed:

   $ info g77

   gets you the toplevel page.

   $ info g77 invoking overall

   gets to the page describing the options.

Regards,
Mumit



More information about the Gcc-help mailing list