I am trying to create a Fortran DLL containing a Common Block which I can then use to link with a C program to resolve an external name.
The DLL appears to create successfully but when I link the C program I always get an unresolved external symbol. This code does work when the Fortran part is not built as a DLL. Does anybody have any ideas ?
I have shown my code below.
!DEC$ DEFINE GLOBAL_EXPORT
data PRBUZ /0.0/
GLOBAL01.FI include file:
COMMON /GLOBAL01/ prbuz
!DEC$ IF DEFINED (GLOBAL_EXPORT)
!DEC$ ATTRIBUTES DLLEXPORT :: /GLOBAL01/
!DEC$ ATTRIBUTES DLLIMPORT :: /GLOBAL01/
struct g1 struct
extern struct g1 global01;
global01.prbuz = 50.0;
When this is linked against the above DLL I always get GLOBAL01 reported as undefined.