Library problems

I’m working on a library which is also registered at PIO. I get many compiling errors because it seems the system does not know which library or parts of it should compiled.
I want that only the libraries which are in the lib folder should compiled, no extern libraries. How to do this?

At the risk of me sounding stupid, can you create a project which only uses the files in the lib dir?

Or maybe this might help Recommended project setup for library development


That is what I want, but how to do this?

I’m working on some libraries at the moment. To test them, I create a project and write a file in src to use only my library (or, if necessary, others I have already tested).

For example, I’ve written a library to emulate the Arduino’s Serial interface, it just uses the usart and interrupts. My test code simply writes to and reads from the usart. The library files, one header and one source, go in the lib directory in a subdirectory named after the library, lib/AVRusart in my case.

A quick compile and a static library is created (under .pio…) and linked with the test code. Upload and check that it works.


  • Test code in src/main.cpp;
  • Library header in lib/AVRusart/AVRusart.h;
  • Library source in lib/AVRusart/AVRusart.cpp;



There could be a billion causes for that, can you share the exact error message and code?

You can look at the ‘dependency graph’ at the start of compilation and then lib_ignore every library which you deem was falsely included. That may however not be the correct solution here.

After a Clean it works now.