Compiler Error C2002

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2002.

invalid wide-character constant

The multibyte-character constant is not valid.

To fix by checking the following possible causes

  1. The wide-character constant contains more bytes than expected.

  2. The standard header STDDEF.h is not included.

  3. Wide characters cannot be concatenated with ordinary string literals.

  4. A wide-character constant must be preceded by the character 'L':

    L'mbconst'  
    
    
  5. For Microsoft C++, the text arguments of a preprocessor directive must be ASCII. For example, the directive, #pragma message(L"string"), is not valid.

Show: