Undefined reference to `vtable for <class name>'

I’d like to have separate files for headers and implementation of my usermod, but whenever I put an implementation into a separate file, I get the error undefined reference to 'vtable for <class name>'.


#ifndef BLA_H
#define BLA_H

class Bla {
        virtual void Test();

#include "Bla.hpp"

void Bla::Test() { }
In any other file
#include "Bla.hpp"

Bla bla;

What do I have to do to make it work?

I got it now.

I had put all files inside usermods/<modname>, but .cpp files have to be inside wled00.

Not a proper solution but that is a shortcoming of WLED folder structure.
Unfortunately moving complete usermods folder under wle00 parent folder would remove all commit history stripping credit of many contributors.

It’s for development and compiling only. After that, everything’s gonna be put back into the usermods folder.

I’d be extremely happy if anyone could show me another way. :smiley: