If you declare a variable in a common block, and you define it in a subroutine(SET_DEFAULT), then if the subroutine is in a separate file but linked into the main.exe as an obj, then it works fine, but if the separate file is compiled and linked into a DLL, which then is loaded during compilation, then it will fail under UNDEF (reference to undefined variable).
ftn95 /windows /zero /f2k /cfpp /free /64 /undef /debug LIBRARIES.for ftn95 /windows /zero /f2k /cfpp /free /64 /undef /debug main.f90 slink64 libraries.obj /file:libraries.dll slink64 main.obj libraries.dll /file:main.exe
It fails also under 32bit.
SUBROUTINE SET_DEFAULT()
INTEGER*4 IVERS
INTEGER(kind=7) IADD
COMMON /EZ/ IVERS, IADD
INTEGER*4 :: IVERS2 = 10
INTEGER(kind=7) :: IADD2 = 30429112
IVERS = IVERS2
IADD = IADD2
END SUBROUTINE
PROGRAM MAIN
INTEGER*4 IVERS
INTEGER(kind=7) IADD
COMMON /EZ/ IVERS, IADD
CALL SET_DEFAULT()
PRINT*,'IVERS=',IVERS
PRINT*,'IADD=',IADD
END PROGRAM