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 (level 1) C4488

Error Message

'function' : requires 'keyword' keyword to implement the interface method 'interface_method'

A class must implement all members of an interface from which it directly inherits. An implemented member must have public accessibility, and must be marked virtual.

Example

C4488 can occur if an implemented member is not public. The following sample generates C4488.

// C4488.cpp
// compile with: /clr /c /W1 /WX
interface struct MyI {
   void f1();
};

// implemented member not public
ref class B : MyI { virtual void f1() {} };  // C4488

// OK
ref class C : MyI {
public:
   virtual void f1() {}
};

C4488 can occur if an implemented member is not marked virtual. The following sample generates C4488.

// C4488_b.cpp
// compile with: /clr /c /W1 /WX
interface struct MyI {
   void f1();
};

ref struct B : MyI { void f1() {} };   // C4488
ref struct C : MyI { virtual void f1() {} };   // OK

Community Additions

ADD
Show:
© 2015 Microsoft