How do you handle a “cannot instantiate abstract class” error in C++?

后端 未结 8 2045
暗喜
暗喜 2020-12-15 17:02

How do you handle a \"cannot instantiate abstract class\" error in C++? I have looked at some of the similar errors here and none of them seem to be exactly the same or prob

相关标签:
8条回答
  • 2020-12-15 17:51

    Visual Studio's Error List pane only shows you the first line of the error. Invoke View>Output and I bet you'll see something like:

    c:\path\to\your\code.cpp(42): error C2259: 'AmbientOccluder' : cannot instantiate abstract class
              due to following members:
              'ULONG MysteryUnimplementedMethod(void)' : is abstract
              c:\path\to\some\include.h(8) : see declaration of 'MysteryUnimplementedMethod'
    
    0 讨论(0)
  • 2020-12-15 17:55

    I have answered this question here..Covariant virtual functions return type problem

    See if it helps for some one.

    0 讨论(0)
提交回复
热议问题