PRB: RCPP.EXE Error: Compiler Limit: Macro Expansion Too Big

Last reviewed: July 22, 1997
Article ID: Q43369
3.00 3.10 WINDOWS kbtool kbprg kbprb kbcode

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.0 and 3.1

SYMPTOMS

The Windows Resource Compiler produces the following error message:

   ~rc1234.tmp(145) : FATAL : compiler limit : macro expansion too big
   EXEC Failed - make sure RCPP.EXE is installed correctly.

This error message may be encountered when you are using a "chaining" technique to define the identifiers for strings that are located within a stringtable in your resource file.

The identifiers are defined in an include file. "Chaining" means that the value of an identifier depends on the value of the previous identifier plus a predefined increment. The following is an example:

#define  ID_START    100
#define  ID_INC      1

#define  ID1         ID_START
#define  ID2         ID1 + ID_INC
#define  ID3         ID2 + ID_INC
#define  ID4         ID3 + ID_INC
#define  ID5         ID4 + ID_INC
   :      :                     :
   :      :             :
  etc    etc           etc

The advantage of this "chaining" technique is that when identifiers are added, it ensures that every identifier will be unique.

CAUSE

This problem is occurring because the RC compiler does not do mathematical computation. The lines of code above would actually be expanded as follows:

======== Original code ======== =========== EXPANDED CODE ========

#define  ID_START    100         100
#define  ID_INC        1         1

#define  ID1    IDSTART          100
#define  ID2    ID1 + ID_INC     100 + 1
#define  ID3    ID2 + ID_INC     100 + 1 + 1
#define  ID4    ID3 + ID_INC     100 + 1 + 1 + 1

etc.

What is happening is that after so many lines, the expansion of the line is exceeding the buffer allotted for macro expansions. Since the RC compiler does not do arithmetic, it interprets all #defines as characters.


Additional reference words: 3.00 3.10
KBCategory: kbtool kbprg kbprb kbcode
KBSubcategory: TlsRc
Keywords : kb16bitonly


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.