This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
A novice really trying to run MinGW to compile FORTRAN 77
- From: "frank.shed via fortran" <fortran at gcc dot gnu dot org>
- To: <fortran at gcc dot gnu dot org>
- Date: Tue, 3 Jul 2018 13:46:32 +0100
- Subject: A novice really trying to run MinGW to compile FORTRAN 77
- Reply-to: "frank.shed" <frank dot shed at btinternet dot com>
Hallo,
Can you help me please.
For a task I'm doing I have managed to get a software program, which is
quite old and written in Fortran 77 computer language. The program runs ok
on a Windows system provided you have a GFortran Compiler. I have downloaded
the Fortran Compiler (MinGW) and installed it on my laptop Windows 10. To
demonstrate it is installed there are a couple of simple checks to show the
software version number and separately a "help" page. Both these work ok.
I got some instructions for this from the "MinGW" website.
I have also copied down a very simple Fortran program, "hallo.for", three
lines of text, and loaded them into a folder I newly opened called
"programs", this is inside the MinGW directory, which as advised, is on the
main "C" drive.
The program run in DOS, by the command prompt.
1.) At the command prompt I type cd C:\ then press enter this
gives C:\ >
2.) I then type cd C:\MinGW\programs then press enter
this gives C:\MinGW\programs > this is the folder where my simple
"hallo" program is
3.) I then type gfortran -ffree-form hallo.for -o hallo.exe
this is the instruction given to access the file, compile and run the simple
"hallo" program
It doesn't work I get the error message -- gfortran : error : hallo.for :
no such file or directory
For line item 3.) above I also tried gfortran hallo.for -o hallo.exe
This doesn't work I get the error message -- gfortran : error : hallo.for
: no such file or directory
I have also tried gcc -ffree-form hallo.for -o hallo.exe and gcc
hallo.for -o hallo.exe
This doesn't work I get the same error message for both -- gcc : error :
hallo.for : no such file or directory
gcc : fatal error : no input files
compilation stopped
I have tried many alternative ways to do this but the instructions provided
by MinGW are wide-ranging, covering many different operating systems and
different computer languages.
I really would like your help and think I am doing something very stupid and
basically wrong.
Regards
Frank