Specifying Consistent Library Types

There are a number of Visual C++ run-time libraries that offer the same entry points but have different characteristics. The default Visual C++ library is libc.lib, which is single threaded, non-debug, and static. The Visual C++ and Visual Fortran libraries must be the same types. The incompatible types are:

The default Fortran libraries depend on the project type:

Fortran Project Type Default Libraries Used
Fortran Console Static, single-threaded libraries dfor.lib and libc.lib
Fortran Standard GraphicsStatic, multithreaded libraries dformt.lib and libcmt.lib
Fortran QuickWinStatic, multithreaded libraries dformt.lib and libcmt.lib
Fortran WindowsStatic, multithreaded libraries dformt.lib and libcmt.lib
Fortran DLLDynamic-link libraries dfordll and msvcrt (and their import libraries)
Fortran Static LibraryStatic, single-threaded libraries dfor.lib and libc.lib

Pure Fortran applications can have mismatched types of libraries. One common scenario is a Fortran QuickWin application that links with a Fortran Static library. Fortran QuickWin (and Fortran Standard Graphics) applications must use the static, multithreaded libraries, and by default, Fortran Static libraries are built using static, single-threaded libraries. This causes a conflict, so the Fortran Static library and the QuickWin application must both be built using static, multithreaded libraries.

Similarly, different C/C++ applications link against different C libraries. If you mix the different types of applications without modifying the defaults, you can get conflicts. The debug version of a library has a letter "d" appended to its base file name:

When using a Debug configuration, Visual C++ selects the debug libraries. Visual Fortran does not select debug libraries for any configuration, but provides a Project Settings option to request their use. To specify different types of Fortran libraries in the visual development environment, open the Project Settings dialog box, click the Fortran tab, and select the Libraries category:

For details about the Visual C++ libraries used and compiler options available, see Visual Fortran/Visual C++ Mixed-Language Programs.