When you first create a DLL, you follow the general steps described in Defining Your Project. Select Fortran Dynamic-Link Library as the project type when you create a new project in the Microsoft visual development environment.
To debug a DLL, you must use a main program that calls the library routines (or references the data). From the Project Settings menu, choose the Debug tab. A dialog box is available for you to specify the executable for a debug session.
To build the DLL from
the Microsoft visual development environment:
For example, in the case of a common block containing four-byte variables, in the Project Setting dialog box you might specify:
The Microsoft visual development environment automatically selects the correct linker instructions for loading the proper run-time library routines (located in a DLL themselves). Your DLL is created as a multithread-enabled library. An import library (.LIB) is created for use when you link images that reference the DLL.
To build the DLL from
the command line:
f90arr.f90
, use the following command line:
DF /dll f90arr.f90
This command creates:
f90arr.dll
.f90arr.lib
, that you must link with applications that
call your DLL.If you also specify /exe:file or /link /out:file, you name a .DLL rather than an .EXE file (the default file extension becomes projectname.DLL instead of projectname.EXE)
The /dll option selects as the default the DLL run-time libraries to support multithreaded operation.
For example, if your DLL exports a common block containing four-byte variables, you might use the following command line (specify the /dll option):
DF /align:commons /dll dllfile.for
The /dll option automatically selects the correct linker instructions for loading the proper run-time library routines (located in a DLL themselves). Your DLL is created as a multithread-enabled library.
For more information, see: