Compile all multithreaded applications on Windows NT and Windows 95 systems with the -D_MT switch. This ensures that reentrant definitions, such as errno, are used with the application being built. Applications should also use the -DWIN32 and -D_DLL compiler switches. For example:
% CL /c myprog.c -D_MT -DWIN32 -D_DLL
The appropriate switches for compiling a multithreaded application can be obtained by using the $(CVARSMTDLL) switch found in the NTWIN32.MAK file. See the Building Apps/DLLs QuickRef documentation available through the Win32 SDK Online References (Common) online help icon for more build details.