Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiling fortran with f77 gcc 1

Status
Not open for further replies.

ArmenD

Programmer
Feb 3, 2005
101
US
hi,

here is the code
Code:
SUBROUTINE sayhello()
WRITE(*,*) 'Hello World!'
END

I type " f77 -c helloImp.f" and i get...
Code:
helloImp.f:1:
   SUBROUTINE sayhello()
   ^
Invalid first character at (^) [info -f g77 M LEX]
helloImp.f:2:
   WRITE(*,*) 'Hello World!'
   ^
Invalid first character at (^) [info -f g77 M LEX]
helloImp.f:3:
   END
   ^
Invalid first character at (^) [info -f g77 M LEX]

any ideas? it's pretty simple, i don't know why it doesn't compile?
 
Sacramental 7-th position?
Alas, I don't know can gcc f77 read free format...
 
It expects statements to start in the 7th character position. Positions 1 to 5 are for labels and position 6 is for a continuation character.
Code:
      SUBROUTINE sayhello()
      WRITE(*,*) 'Hello World!'
      END

CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top