awa5114
Structural
- Feb 1, 2016
- 135
I am trying to compile the sample code provided in example 1 of [this link][1] using GNU Fortran. I have placed the source code in a .f95 file called "Test" and tried to compile it in `cmd` using
`gfortran test.95`
This throws quite a few errors as shown below:
C:\Program Files (x86)\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0>echo off
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>D;
'D' is not recognized as an internal or external command,
operable program or batch file.
C:\>D:
D:\>cd TEMP\FortranTest
D:\TEMP\FortranTest>gfortran test.f95
test.f95:8:20:
GENERIC :: READ (FORMATTED) => UDIO_READ_ARRAY
1
Error: Expected '=>' at (1)
test.f95:12:17:
INTERFACE WRITE(FORMATTED)
1
Error: Syntax error: Trailing garbage in INTERFACE statement at (1)
test.f95:13:21:
MODULE PROCEDURE UDIO_WRITE_ARRAY
1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
test.f95:14:5:
END INTERFACE
1
Error: Expecting END MODULE statement at (1)
test.f95:51:6:
USE TYPES
1
Fatal Error: Can't open module file 'types.mod' for reading at (1): No such file
or directory
compilation terminated.
D:\TEMP\FortranTest>
Why is this happening? How can I fix it?
[1]:
`gfortran test.95`
This throws quite a few errors as shown below:
C:\Program Files (x86)\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0>echo off
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>D;
'D' is not recognized as an internal or external command,
operable program or batch file.
C:\>D:
D:\>cd TEMP\FortranTest
D:\TEMP\FortranTest>gfortran test.f95
test.f95:8:20:
GENERIC :: READ (FORMATTED) => UDIO_READ_ARRAY
1
Error: Expected '=>' at (1)
test.f95:12:17:
INTERFACE WRITE(FORMATTED)
1
Error: Syntax error: Trailing garbage in INTERFACE statement at (1)
test.f95:13:21:
MODULE PROCEDURE UDIO_WRITE_ARRAY
1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
test.f95:14:5:
END INTERFACE
1
Error: Expecting END MODULE statement at (1)
test.f95:51:6:
USE TYPES
1
Fatal Error: Can't open module file 'types.mod' for reading at (1): No such file
or directory
compilation terminated.
D:\TEMP\FortranTest>
Why is this happening? How can I fix it?
[1]: