1

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.

picture

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • Are you sure you're using it correctly; the -o option is where to output the compiled code & it's normally not given a code.f type of name, that's usually used for the input you've used the name code for.... ie. [-o outfile] infile... is from man gfortran; you appear to have file order reversed. – guiverc Jul 13 '22 at 06:45
  • 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:54
  • Can you post a screenshot? – Archisman Panigrahi Jul 13 '22 at 07:06
  • shared for your consideration – Vishal Srivastava Jul 13 '22 at 07:14

1 Answers1

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