C++ undefined vtable

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

C++ undefined vtable

跳至解决方案
1,539 次查看
giacomopetrini
Contributor IV

Hello,

I'm using KDS 1.1.1 and KSDK 1.0.0 all updated.

 

I'm trying to port this library: adafruit/Adafruit_10DOF · GitHub (adafruit/Adafruit_Sensor · GitHub) to the Kinetis (FRDM-K64F board to be exact).

 

The problem is that:

- I don't know C++ very well

- it gives me an error and I don't know what to do.

 

The error:

<path>/Adafruit/Adafruit_Sensor.h:139: undefined reference to `vtable for Adafruit_Sensor'

 

The code is this:

 

class Adafruit_Sensor {

public:

  // Constructor(s)

void constructor();

 

 

  // These must be defined by the subclass

  virtual void enableAutoRange(bool enabled) {};

  virtual void getEvent(sensors_event_t*);

  virtual void getSensor(sensor_t*);

 

private:

  bool _autoRange;

};

 

and the cpp file contains:

 

#include "Adafruit_Sensor.h"

 

void Adafruit_Sensor::constructor() {

}

 

Some ideas?

 

Thanks Bye

Giacomo

标签 (1)
0 项奖励
回复
1 解答
1,324 次查看
giacomopetrini
Contributor IV

OK, problem solved, it was the Adafruit_sensor class not written very well (no distructor,...).

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,325 次查看
giacomopetrini
Contributor IV

OK, problem solved, it was the Adafruit_sensor class not written very well (no distructor,...).

0 项奖励
回复