FIX: Foundation Class Library Makefile Builds Wrong Library

Last reviewed: September 16, 1997
Article ID: Q107868
7.00 | 1.00 MS-DOS | WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with:

        - Microsoft C/C++ version 7.0
        - Microsoft Visual C++ for Windows, version 1.0
    

SYMPTOMS

Specifying DLL=0 when building the Microsoft Foundation Class (MFC) Library versions 1.0 and 2.0 variants causes the large-model version of the requested library to be built even when a different memory model is requested.

CAUSE

The only memory model possible when building a dynamic-link library (DLL) version of an MFC Library is large. The makefile provided to build the MFC Library variants sets the memory model to large whenever the DLL option is specified. This happens even when the value of the DLL option is set to 0 (zero) to indicate that a DLL is not being built.

RESOLUTION

Do not specify the DLL option when building a non-DLL version of an MFC Library.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Foundation Classes versions 1.0 and 2.0, for MS-DOS and Windows, which come with Microsoft C/C++ 7.0 and Visual C++ 1.0. This has been fixed in the Microsoft Foundation Classes version 2.5 for MS-DOS and Windows, which comes with Microsoft Visual C++ version 1.5.

MORE INFORMATION

A makefile, filename MAKEFILE, is provided in the MFC\SRC directory for the purpose of building various versions of the MFC Library. A README.TXT file in the MFC\SRC directory describes the syntax needed to build the different library types.

Note that the parameters passed to this makefile are case-sensitive; they MUST be in uppercase letters for the makefile to recognize them.

The following command entered in the MFC\SRC directory will build the large- model, Windows-targeted, version of the Microsoft Foundation Class library (lafxcwd) rather than the expected medium-model version (mafxcwd):

   NMAKE MODEL=M TARGET=W DLL=0

The correct library can be obtained by not specifying the DLL option as shown below:

   NMAKE MODEL=M TARGET=W


Additional reference words: 7.00 1.00 2.00
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: MfcMisc
Keywords : kb16bitonly MfcMisc kbbuglist kbfixlist kbprg
Technology : kbMfc
Version : 7.00 | 1.00
Platform : MS-DOS WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.