C++ undefined vtable

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,543件の閲覧回数
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,328件の閲覧回数
giacomopetrini
Contributor IV

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

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,329件の閲覧回数
giacomopetrini
Contributor IV

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

0 件の賞賛
返信