I have a folder containing multiple .h and .cpp files. How do I include this in two different projects? Ideally I would just put the link to this folder somewhere in the platformio.ini, but it seems the only way I can get .cpp files to work is if they are in the src folder. I’ve tried a lot of different things.
You can put library folders which you want to share in a folder (say C:\Users\<user>\Documents\my_libraries) and then use lib_extra_dirs with the absolute or relative path to my_libraries .
I have tried that but then how do I include the files?
lib_extra_dirs = C:\Users\user\Documents\arduino\libraries
And then my library is in C:\Users\user\Documents\arduino\libraries\mylibrary
the library.json has a “name” of “mylibrary” and one of the “headers” is “Utility.h”.