Program won't compile (Fortran 77)

  • Context: Fortran 
  • Thread starter Thread starter Nano-Passion
  • Start date Start date
  • Tags Tags
    Program
Nano-Passion
Messages
1,291
Reaction score
0
This is my program:

PROGRAM practice

integer:: A

Read*, A

print*, A

END PROGRAM

Very simple program, just a test. I'm using "Force 2.0" for Fortran 77

But this keeps coming out

C:\Program Files\Force 2.0\bin\ld.exe:C:\Users\Dr. Ghobrial\Desktop\Source2.~f: file format not recognized; treating as linker script
C:\Program Files\Force 2.0\bin\ld.exe:C:\Users\Dr. Ghobrial\Desktop\Source2.~f:1: syntax error
collect2: ld returned 1 exit status


Any ideas?
 
Judging from the output problems have nothing to do with the syntax, rather the compiler is trying to read wrong file.

But that's just a guess, I have never used Force (too low level of midi-chlorians).
 
Using ".~f" as a file name suffix seems a strange idea, unless the Force 2.0 documentation told you to do that.

Try .f77, .F77, or even just .f or .F (often f and F indicate the source code is in fixed format or free format).
 
Borek said:
Judging from the output problems have nothing to do with the syntax, rather the compiler is trying to read wrong file.

But that's just a guess, I have never used Force (too low level of midi-chlorians).

:smile:

AlephZero said:
Using ".~f" as a file name suffix seems a strange idea, unless the Force 2.0 documentation told you to do that.

Try .f77, .F77, or even just .f or .F (often f and F indicate the source code is in fixed format or free format).

I didn't put .~F, the program did that automatically.

.F worked though, thank you!
 
I'm guessing that you didn't have a file extension at all - that your file's name was Source2, with no extension. The compiler was probably looking for any files with a .F or similar file extension.
 
Mark44 said:
I'm guessing that you didn't have a file extension at all - that your file's name was Source2, with no extension. The compiler was probably looking for any files with a .F or similar file extension.

Yep you guessed right. It was a silly mistake, I haven't programmed in a while.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 16 ·
Replies
16
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 6 ·
Replies
6
Views
2K