Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Warning C4687

Error Message

'class': a sealed abstract class cannot implement an interface 'interface'

A sealed, abstract type is typically only useful to hold static member functions.

For more information, see abstract (Visual C++)and sealed.

C4687 is issued as an error by default. You can suppress C4687 with the warning pragma. If you are certain that you want to implement an interface in a sealed, abstract type, you can suppress C4687.


The following sample generates C4687.

// C4687.cpp
// compile with: /clr /c
interface class A {};

ref struct B sealed abstract : A {};   // C4687
ref struct C sealed : A {};   // OK
ref struct D abstract : A {};   // OK

Community Additions

© 2015 Microsoft