Need suggestion in 'Undefined reference' error during compilation

Hello everyone,

I’m facing an error while trying to compile my project in PlatformIO, and I’m hoping someone here might have encountered a similar issue and can offer some guidance.

Error Name: ‘Undefined reference’ error during compilation
Description: I’m getting the ‘undefined reference’ error when I try to compile my code using PlatformIO. I’ve double-checked my code and library dependencies, but I can’t seem to figure out what’s causing this issue. It’s preventing me from progressing with my project, and I’m not sure where to start troubleshooting.

Thanks in advance!"

Please show the detailed error log.
Without this, it is difficult to make a statement.

In the meantime, here are some generic C++ examples and solutions to this error: https://www.softwaretestinghelp.com/cpp-errors/

src/main.cpp: In function 'int main()':
src/main.cpp:10:15: error: 'undefined_function' was not declared in this scope
     undefined_function();
     ^~~~~~~~~~~~~~~~~
src/main.cpp:20:10: error: 'undefined_variable' was not declared in this scope
     int x = undefined_variable;
          ^
Compilation failed

I also check your link, that is really helpful in my upcoming project. Need suggestion in 'Undefined reference' error during compilationgcp training

Can you also share the source code?