Undefined reference to `Class::Method()

No. You’re implementing classes wrong. See https://www.learncpp.com/cpp-tutorial/class-code-and-header-files/.

The TestLib.h is fine but TestLib.cpp must be

#include <TestLib.h>
#include <Arduino.h>

void Test::test() {
   Serial.println("Hi"); //took liberty to change print to println
}

This is purely a C++ language problem you’re having, not anything with PlatformIO.

1 Like