Name
#error directive — Issues an error message
Synopsis
#error message
The #error
directive tells
the preprocessor to issue an error message and mark the source file as
ill-formed, just as if the programmer made a programming error that
the compiler detected. You can supply any sequence of preprocessor
tokens as the message
, and those tokens are
echoed in the error message.
Example
#if !defined(_ _cplusplus) || (_ _cplusplus < 199711L) #error Not a conforming C++ compiler. #endif
See Also
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.