C++ undefined vtable

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C++ undefined vtable

Jump to solution
700 Views
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

Labels (1)
0 Kudos
1 Solution
485 Views
giacomopetrini
Contributor IV

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

View solution in original post

0 Kudos
1 Reply
486 Views
giacomopetrini
Contributor IV

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

0 Kudos