From RAD Studio
Jump to: navigation, search

Go Up to Preprocessor Directives Index


#error Your error message


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.