Compiler Error C2097

 

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 C2097.

illegal initialization

To fix by checking the following possible causes

  1. Initialization of a variable using a nonconstant value.

  2. Initialization of a short address with a long address.

  3. Initialization of a local structure, union, or array with a nonconstant expression when compiling with /Za.

  4. Initialization with an expression containing a comma operator.

  5. Initialization with an expression that is neither constant nor symbolic.

Show: