Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Program won't compile (Fortran 77)

  1. May 22, 2012 #1
    This is my program:

    PROGRAM practice

    integer:: A

    Read*, A

    print*, A


    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?
  2. jcsd
  3. May 23, 2012 #2


    User Avatar

    Staff: Mentor

    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).
  4. May 23, 2012 #3


    User Avatar
    Science Advisor
    Homework Helper

    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).
  5. May 23, 2012 #4

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

    .F worked though, thank you!
  6. May 23, 2012 #5


    Staff: Mentor

    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.
  7. May 23, 2012 #6
    Yep you guessed right. It was a silly mistake, I haven't programmed in a while.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook