Creating a new local library

I am trying to create a new local library. I first tried creating a directory outside PIO, the directory and files became visible within PIO. I then tried to build the project and the project compiled but would not link with unresolved references to the new functions.

I deleted that directory and then created the directory and files within PIO. I had the same unresolved references during linking.

The files and directory are colored green. What do I have to do to have these directories and files brought into the project?

Unfortunately, your descriptions are vague and difficult to follow.

When you start developing a local library, create a project.

Within the lib folder, create a new folder for your library. In this folder, create the library.json and the subfolder src in which you place the source code of your library.

The project is also used to test your library. Simply include the library in your project with #include <MyLib.h>.

.
├── include
├── lib
│   └── MyLib
│       ├── src
│       │   ├── MyLib.cpp
│       │   └── MyLib.h
│       └── library.json
├── src
|   └── main.cpp
├── test
├── .gitignore
└── platformio.ini

If the basic function of your library is given, upload it to Github, for example. You can then simply integrate the library into other projects via platformio.ini using lib_deps = https://github.com/your-github-username/name-of-the-repository.

Some of the libraries in this project do not have library.json files, they only have library.properties files. What is the minimum that needs to be in the library.json file?

The bare minimum is name and version

{
  "name" : "MyLib",
  "version" : "1.0.0"
}

The version field must use semantic versioning, See version — PlatformIO latest documentation

It sounds as if you don’t create a new library but use an existing one in your project.

If this is the case, you can simply copy the library to the lib folder. You do not have to create the library.json manually yourself.

.
├── ...
├── lib
│   └── YourLib
│       ├── src
│       │   ├── YourLib.cpp
│       │   ├── YourLib.h
│       │   └── ...
|       ├── ...
|       ...
├── ...
...

I am working with the Tasmota project. There are lots of different library directories from various sources with varying contents. I will do a new Git pull and try to create a new directory based on your suggestions. In other IDEs, creating a new library was very straight forward.

I think there is still a misunderstanding.

Do you want to create a new library or do want to use an existing library?

For the latter use lib_deps in the platformio.ini
See lib_deps — PlatformIO latest documentation

I want to create some new local libraries for my Tasmota project.