#error
Go Up to Preprocessor Directives Index
Syntax
#error Your error message
Description
The #error directive generates the message:
[<compiler> Error] <filename>(<line number>): <error code> Error directive: Your error message
This directive is usually embedded in a preprocessor conditional statement that catches some undesired compile-time condition. In the normal case, that condition will be false. If the condition is true, you want the compiler to print an error message and stop the compilation. You do this by putting an #error directive within a conditional statement that is true for the undesired case.