Hi,
i was placing some routines in submodules, when i stumbled upon this error:
error #7371: An object in a COMMON block with DEC$ ATTRIBUTES DLLIMPORT cannot be initialized. [BAR]
Reproducer:
module M_TEST
implicit none
interface
module real function foo()
!DIR$ ATTRIBUTES DLLEXPORT,ALIAS:"foo" :: foo
end function
end interface
end module
submodule(M_TEST) M_TEST_S
implicit none
contains
module real function foo()
!DIR$ ATTRIBUTES DLLEXPORT :: foo
real, save :: bar = 1.0 ! Explicit save not required for error
foo = 1.0
end function
end submoduleCompiler: 16.3.207
Options: /dll /nologo
Best regards,
Wolf