Hi,
The following code does not compile under nvfortran 24.5. We use this structure to avoid a compilation cascade when modifying the body of procedure1. If procedure1 is put in a submodule of Mod_type1, then it works.
module Mod_Type1
implicit none
private
public :: Type1
type :: Type1
contains
procedure :: procedure1
end type
interface
subroutine procedure1(a)
import
class(Type1) :: a
end subroutine
end interface
end module
subroutine procedure1(a)
use Mod_Type1
implicit none
class(Type1) :: a
write(*,*) 'a'
end subroutine
module Mod_Type2
use Mod_Type1
type, extends(Type1) :: type2
end type
end module
program main
use Mod_Type2
implicit none
type(Type2) :: Type2Object
call Type2Object%procedure1
end program
The return error is:
/usr/bin/ld: /tmp/nvfortranGxfdbGTLhonsS.o:(.data+0x98): undefined reference to `mod_type1_procedure1_’
Thanks for the help!