[Quote=引用 1 楼 lingyin55 的回复:]
The #error Directive
Error directives produce compiler-time error messages.
#error token-string
Remarks
The error messages include the argument token-string and are currently not subject to macro expansion. These directives are most useful for detecting programmer inconsistencies and violation of constraints during preprocessing. The following example demonstrates error processing during preprocessing:
Copy Code
#if !defined(__cplusplus)
#error C++ compiler required.
#endif
When #error directives are encountered, compilation terminates.
Error directives produce compiler-time error messages.
#error token-string
Remarks
The error messages include the argument token-string and are currently not subject to macro expansion. These directives are most useful for detecting programmer inconsistencies and violation of constraints during preprocessing. The following example demonstrates error processing during preprocessing:
Copy Code
#if !defined(__cplusplus)
#error C++ compiler required.
#endif
When #error directives are encountered, compilation terminates.