Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Error 7371 with save attribute in submodule routine

$
0
0

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 submodule

Compiler: 16.3.207
Options: /dll /nologo

Best regards,

Wolf

Zone: 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>