I am compiling a FORTRAN code using gfortran (gfortram -o code.f code) and preparing an executable (code). It is compiled but the executable (code) looks like a file. How to solve this problem.
Asked
Active
Viewed 32 times
1
1 Answers
0
Assuming your source is called source.f
and the output is output
, the syntax is
gfortran -o output source.f

Archisman Panigrahi
- 28,338
- 18
- 105
- 212
-
I have also tried this way.. but the problem is same. it is compiled and executable say output is working using ./output. but this executable looks like a file. – Vishal Srivastava Jul 13 '22 at 06:52
-o
option is where to output the compiled code & it's normally not given acode.f
type of name, that's usually used for the input you've used the namecode
for.... ie.[-o outfile] infile...
is fromman gfortran
; you appear to have file order reversed. – guiverc Jul 13 '22 at 06:45