Lahey/GNU Fortran

Creating Applications and Libraries

Console Applications

LGF creates Windows console-mode executables by default, so no options need be specified.

Example

LGF MYPROG.F90

Windows GUI Applications

To create a Windows GUI application, either with a third-party package (such as WiSK) or by calling the Windows API's directly, specify -WIN.

When .rc (resource) files are specified on the command line, the resource compiler is invoked and the resulting .res file is linked with the application.

Example

LGF MYPROG.F90 RESOURCE.RC -win

Static Libraries

To create a static library, specify the library name using -OUT. LGF recognizes that a library is requested because of the .a extension for the output file. This the arhiver to be invoked rather than the linker. If the library specified does not exist, it is created; if it already exists, it is updated.

Example

LGF mysub.f90 -out mylib.a

Dynamically Linked Libraries

To create a Windows DLL, use -DLL.

Example

LGF myprog.f90 -dll -win

For more information on DLLs, see Dynamically Linked Applications.