LF Fortran 95  

Fortran Calling Fortran DLLs

Even though the same language system is used to create both the DLL and the executable, the mixed language rules must be observed. Create the Fortran DLL as described in Building Fortran DLLs, building with the -ml lf95 compile option:

lf95 source.f90 -win -dll -ml lf95

LF95 builds the DLL source.dll. It also generates a source.lib file containing definitions needed to link to this DLL.

Next build the Fortran Main with:

lf95 main.f90 -win -ml lf95 source.lib

To run the program, the DLL must be in the same directory as the executable, or in a directory on the path.