AnsweredAssumed Answered

C++ undefined vtable

Question asked by giacomopetrini on Nov 3, 2014
Latest reply on Nov 4, 2014 by giacomopetrini


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 {


  // 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*);



  bool _autoRange;



and the cpp file contains:


#include "Adafruit_Sensor.h"


void Adafruit_Sensor::constructor() {



Some ideas?


Thanks Bye