Shared library in Fortran, minimal example does not work

I am trying to understand how to dynamically create and link a shared library in Fortran under Linux. I have two files: The first one, liblol.f90, looks like this: subroutine func() print*, '...