Specifications
Resource Compiler Messages Page 8 of 24
Resource Compiler Error RC2017
illegal escape sequence
An escape sequence appeared where one was not expected. An escape sequence - a backslash ( \ )
followed by a number or letter - may occur only in a character or string constant.
Resource Compiler Error RC2018
unknown character ’hexnumber’
The ASCII character corresponding to the given hexadecimal number appeared in the source file but is
an illegal character. One possible cause of this error is corruption of the source file.
Resource Compiler Error RC2019
expected preprocessor directive, found ’character’
The given character followed a number sign (#), but it was not the first letter of a preprocessor
directive.
Resource Compiler Error RC2020
illegal digit number for base radix
The specified digit is not a valid digit for the base specified by radix. Either the digit or the radix could
be incorrect. Octal digits must be numbers from 0 to 7, and hexadecimal digits must be numbers from
0 to 9 or letters from A through E.
Resource Compiler Error RC2021
expected exponent value, not ’character’
The given character was used as the exponent of a floating-point constant but was not a valid number.
Resource Compiler Error RC2022
’number’ : too big for character
The octal number following a backslash (\) in a character or string constant was too large to be
represented as a character.
Resource Compiler Error RC2101
Invalid directive in preprocessed RC file
The RC file contains a #pragma directive. Use the #ifndef preprocessor directive with the
RC_INVOKED constant that the Resource Compiler defines when it processes an include file. Place
the #pragma directive inside a block of code that is not processed when the RC_INVOKED constant
is defined. Code in the block is processed only by the C/C++ compiler and not by the Resource
Compiler. The following sample code demonstrates this technique:
#ifndef RC_INVOKED
#pragma pack(2) // C/C++ only, ignored by Resource Compiler
#endif
The #pragma preprocessor directive has no meaning in an .RC file. The #include preprocessor
directive is used frequently in an .RC file to include a header file (either a project-based custom header
file or a standard header file provided by Microsoft with one of its products). Some of these include
files contain the #pragma directive. Because a header file can include one or more other header files,










