Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.