PRB: RCPP.EXE Error: Compiler Limit: Macro Expansion Too BigLast reviewed: July 22, 1997Article ID: Q43369 |
3.00 3.10
WINDOWS
kbtool kbprg kbprb kbcode
The information in this article applies to:
SYMPTOMSThe 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 etcThe advantage of this "chaining" technique is that when identifiers are added, it ensures that every identifier will be unique.
CAUSEThis 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |