Compiler Error C2474

 

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

keyword' : missing an adjacent semicolon, could be either keyword or identifier.

The compiler expected to find a semicolon, and was unable to determine your intent. Add the semicolon to resolve this error.

The following sample generates C2474.

// C2474.cpp  
// compile with: /clr /c  
  
ref class A {  
   ref class B {}  
   property int i;   // C2474 error  
};  
  
// OK  
ref class B {  
   ref class D {};  
   property int i;  
};  
  
ref class E {  
   ref class F {} property;   
   int i;  
};  

Show: