Compiler Error C3197


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

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

keyword' : can only be used in definitions

A keyword was used in a declaration but is only valid in a definition.

The following sample generates C3197:

// C3197.cpp  
// compile with: /clr /c  
ref struct R abstract;   // C3197  
ref struct R abstract {};   // OK  
public ref class MyObject;   // C3197  
ref class MyObject;   // OK  
public ref class MyObject {};   // OK