The support library DFORMT.LIB is a re-entrant library for creating statically linked multithread programs. The DFORMD.LIB library, which calls code in the shared DFORMD.DLL, is also re-entrant. Programs built with DFORMT.LIB do not share Fortran run-time library code or data with any dynamic-link libraries they call. You must link with DFORMD.LIB if you plan to call a DLL.
To build a multithread application that uses the Fortran run-time libraries, you must tell the linker to use a special version of the libraries. You can specify the /threads compiler option from the command line, or in the Microsoft visual development environment in the Project Settings dialog box, as described in the following paragraph.
A sample multithread project THREADS is included in
the ...\DF98\SAMPLES\ADVANCED\WIN32\THREADS
folder. To build this sample, open the project workspace file and choose Build All from
the Build menu. Listed following are the steps for compiling and linking your own
multithread program using the visual development environment.
To compile and
link your multithread program:
The following steps describe how to compile and link the sample multithread program from the command line.
To compile and
link the sample multithread program from the command line:
DF /threads MYTHREAD.F90
The /threads compiler option (automatically set when you specify a multithread application in the visual development environment) tells the linker to use DFORMT.LIB as a default library.
To compile and link the THREADS.F90 sample, the command is:
DF /winapp /threads THREADS.F90
The /threads compiler option causes the linker to search the multithread library; the /winapp requests a Fortran Windows application.
Select the compiler options /libs=dll and /threads if you are using both multithread code and DLLs. You can use the /libs=dll and /threads options only with Fortran Console projects, not QuickWin applications.