Building Static Libraries
A static library is built on the command line using the LIB command.
LIB libsquare.obj
This creates a new file named libsquare.lib containing libsquare.obj. The default name is derived from the name of the first object file. If the library already exists and you are adding or replace a file in it, the existing library file must be named first.
In Microsoft Visual Studio, a static library is built using a project, which may be either a "Static Library" in Intel Fortran Projects or "Static Library" in Win32 Application Wizard of C++ project.
Using Static Libraries
Source code for programs that use library functions needs nothing special beyond what is needed for nonlibrary functions. For C programs, appropriate prototypes should be in header files that are included in the necessary functions and FORTRAN programs should have interface blocks that give the corresponding information. To keep FORTRAN source code tidy, the interface blocks are commonly placed in a module which is then referenced by USE association.
When building on the command line, static libraries are referenced just like the object files they contain. If they are not located in the current working directory, the LIB environment variable or an explicit path can be used to tell the linker where to search.
In Microsoft Visual Studio, projects in the workspace that depend on static libraries can be made "dependent" on them. If a static library project is not up to date when an application project that depends on it is built, it will be rebuilt automatically.