First, I apologize for my poor English.
Second, This is the code in Dll1
module testmod
implicit none
type :: basetype
integer :: i
contains
procedure :: foo1
procedure :: foo2
end type basetype
contains
subroutine foo1(this)
class(basetype) :: this
end subroutine foo1
subroutine foo2(this)
!DEC$ ATTRIBUTES DLLEXPORT :: foo2
class(basetype) :: this
end subroutine foo2
end module testmod
3. This is the code in Dll2
module callmod
use testmod
implicit none
type :: calltype
contains
procedure :: callfoo2
end type calltype
contains
subroutine callfoo2(this)
!DEC$ ATTRIBUTES DLLEXPORT :: callfoo2
class(calltype) :: this
type(basetype) :: tBase
!call tBase.foo2() ! #1
tBase.i = 2 ! #2
end subroutine callfoo2
end module callmod
4. I Promise the Dll2 can find the *.lib , *.mod and *.dll of the Dll1. The compile will success, When the Dll2 link,
1) if #1 is commeted, #2 is not. link will sucess
2) if #1 not, #2 is commented, link will fail. Output contains "error LNK2001: unresolved external symbol_TESTMOD_mp_FOO1"
5. I don't want to dllexport all the procedure bounded in the basetype, how should i do?
Thank you!



