Include Files for Multithreading

OverviewHow Do ISample

The Microsoft Visual C++ include files contain conditional sections for multithread applications using LIBCMT.LIB. To compile your application with the appropriate definitions, you can:

  • Compile with the Multithread Library compiler option described in the previous section.

  • Define the symbolic constant _MT in your source file or on the command line with the /D compiler option.

Standard include files declare C run-time library functions as they are implemented in the libraries. If you use the Full Optimization (/Ox) or fastcall Calling Convention (/Gr) option, the compiler assumes that all functions should be called using the register calling convention. The run-time library functions were compiled using the C calling convention, and the declarations in the standard include files tell the compiler to generate correct external references to these functions.

See Compiling and Linking Multithread Programs for examples of how to use the _MT constant.