Multiple class method definitions from library include

Which is deadly if your function implementations instead of declarations thus get included into multiple .cpp files and thus creates multiple instances of the same code.

The error is not visible in the code you’ve shown. The problem seems to be in the file defining the State class. Are you using the latest version of GitHub - jrullan/StateMachine: State machine library for Arduino, unmodified? Per Old version available on Platformio · Issue #16 · jrullan/StateMachine · GitHub the registered version is outdated so you’d have to say

lib_deps = https://github.com/jrullan/StateMachine/archive/refs/heads/master.zip
1 Like