PRB: MFC and CRT Must Match in debug/release and static/dynamicLast reviewed: July 2, 1997Article ID: Q166504 |
The information in this article applies to:
SYMPTOMSWhen the MFC and CRT (C Run-Time) libraries do not match in debug/release or in static/dynamic, you get errors such as the following when linking:
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argcMany other strange problems may erupt during build or runtime; memory corruption, memory leaks, complaints from the debug C Run-Time libraries during run-time, and more.
CAUSEWhen building an MFC application or DLL, you need to insure that all relevant libraries are in sync:
RESOLUTIONTo change the type of C Run-Time library used by an application or DLL, go to the Build/Project settings property sheet and switch to the C/C++ tab. On the C/C++ page, choose the "Code Generation" category. Change the value of the "Use run-time library" listbox. Pay careful attention to make this specific for each configuration; only one configuration, such as "Win32 (80x86) Debug," should be selected when you change this value.
Debug, shared library MFC applications - "Debug Multithreaded Dll." Release, shared library MFC applications - "Multithread Dll." Debug, static library MFC applications - "Debug Multithreaded." Release, static library MFC applications - "Multithreaded." STATUSThis behavior is by design.
REFERENCESFor additional information on C Run-Time options and MFC, please see the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q126646 TITLE : PRB: Error Msg: LNK2001 on __beginthreadex and __endthreadex ARTICLE-ID: Q128641 TITLE : The /Mx Compiler Options and the LIBC, LIBCMT, MSVCRT Libs |
Keywords : CRTIss MfcMISC kbbug
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |