Previous Next Up Title Contents Top Library

3.9.6. MIXING LIBRARY TYPES

If your DLL is linked with CRTDLL.LIB , any executables that call your DLL must also be linked with CRTDLL.LIB. Linking the executable with either LIBC.LIB or LIBCMT.LIB and the DLL with CRTDLL.LIB can cause unpredictable results. Unless you are sure that the DLL that the DLL will only be called by EXEs that are linked with CRTDLL.LIB, you must link the DLL with one of the statically linked C run-time libraries(LIBC.LIB or LIBCMT.LIB). If you are unsure, you should link the EXE and all DLLs it will call with CRTDLL.DLL.

If a DLL is linked with LIBC.LIB, and the DLL may be called by a multi-threaded application, multiple threads running in this DLL at the same time will not be supported. This may cause unpredictable results. Therefore, if there is a possibility that the DLL will be called by multi-threaded programs, be sure to link it with one of the libraries that support multi-threaded programs(LIBCMT.LIB or CRTDLL.LIB).


Previous Next Up Title Contents Top Library