I am new to Fortran, so maybe this is a straightforward question, but I haven't found any solution that works by looking through similar posts on SO.
My problem is that when I attempt to compile my main program in testsrft.f95 that uses a module srftModule defined in srft.f95 by executing
gfortran -c dfft.f
gfortran -c srft.f95
gfortran -c testsrft.f95
gfortran dfft.o srft.o testsrft.o -o testsrft
(Subroutines in srftModule require the Fortran77 code in dfft.f), I get the linker error
testsrftF.o: In function `MAIN__':
testsrftF.f95:(.text+0x98): undefined reference to `fftofmat_'
collect2: ld returned 1 exit status
The module's defined as follows
module srftModule
implicit none
contains
... (some subroutines)
subroutine fftofmat(A)
implicit none
real*8, dimension(:, :), intent(inout) :: A
...
end subroutine fftofmat
... (some more subroutines)
end module srftModule
And in my main file, I have
program testsrft
use srftModule
implicit none
...(code to initialize a 10x10 matrix A)
call fftofmat(A)
end program testsrft
Why is the linker complaining?