error: undefined reference to 'vtable for BaseOpengl'
the vtable symbol may be undefined because the class is missing its key function
class BaseOpengl {
public:
int screen_width;
int screen_height;
float* vertexData;
float* fragmentData;
GLint program;
public:
BaseOpengl();
~BaseOpengl();
// 这里写错了
virtual void onCreate();
virtual void onChange(int w, int h)=0;
virtual void onDraw(){};
virtual void destroy(){};
virtual void setPixels(int width, int height, int length, void *data){};
};
虚函数的声明写错了,下面两种写法都可以
virtual void onCreate()=0;
virtual void onCreate(){};