Fortran 90 compiling issue: undefined reference to <modulename>
问题 I'm having trouble trying to compile a simple fortran program which uses a module in the same directory. I have 2 files: test1.f90 which contains the program and modtest.f90 which contains the module. This is test1.f90: program test use modtest implicit none print*,a end program test This is modtest.f90: module modtest implicit none save integer :: a = 1 end module modtest Both files are in the same directory. I compile modtest.f90 and test.f90 like this: gfortran -c modtest.f90 gfortran -o