Without the inclusion of the code in your post, it’s hard to tell exactly what is happening. However, it is most likely that the function declarations/function prototypes are missing, because the code example you are using is meant for the Arduino IDE and the pre-processor they use. i.e. Like in this example code, where modeCommand() is defined around line 151, but there is no function declaration up the top of the file because the Arduino Builder pre-processor will generate it automatically.
You could either:
- Ensure that functions are declared before you use them
- Move the
loop() functions to the bottom of the file… so that all the other functions are defined/implemented BEFORE they are called in
To learn more, have a look at the Declaring Functions here. Also, have a look at the PlatformIO FAQ documentation on converting Arduino files to C++ files.