This documentation is archived and is not being maintained.

Compiler Warning (level 1) C4067

Error Message

unexpected tokens following preprocessor directive - expected a newline

The compiler found, and ignored, extra characters following a preprocessor directive. This warning appears only under ANSI compatibility (/Za).

// C4067a.cpp
// compile with: /DX /Za /W1
#pragma warning(default:4067)
#if defined(X)
#else
#endif v   // C4067
int main()
{
}

To fix by using the following possible solutions

  1. Compile with /Ze.

  2. Use comment delimiters:

// C4067b.cpp
// compile with: /DX /Za /W1
#if defined(X)
#else
#endif
int main()
{
}
Show: