Fatal Error C1022
expected #endif
An #if
, #ifdef
, or #ifndef
directive has no matching #endif
directive. Be sure each #if
, #ifdef
, or #ifndef
has a matching #endif
.
The following sample generates C1022:
// C1022.cpp
#define true 1
#if (true)
#else
#else // C1022
Possible resolution:
// C1022b.cpp
// compile with: /c
#define true 1
#if (true)
#else
#endif
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for