Library with space in name

I’m using a library which contains a space in the name: it’s added correctly, but then the build starts failing: is there a way I can properly escape/quote the name so that the space is handled properly?

Also, I manage to have the build run properly by going into the project .pio/libdeps/ and:

  1. rename the folder
  2. edit the .piopm file and change the library name

Now the build works, but vscode is insisting in marking the included header files as missing.

Is there anything I can do to fix this?

I have no issues (on Windows).

See GitHub - sivar2311/library_with_space_in_name · GitHub

Can you provide a minimal example to reproduce the issue?

1 Like

Did you try underscore instead of space? Is it possible to share a screenshot of the error that you’re seeing?

This might not be a suitable solution if it is about a thirdparty library.

I’m adding a library named “Battery Sense” (I am the author) from the library repository…
Just copy-paste the example code and you should get an error at compile time

In my VS Code/Ubuntu 24.04.4 environment, I’m not experiencing any issues with the library. The sample code also builds without problems.

It seems more likely that the issue occurred during environment setup rather than with PlatformIO itself.

By the way, I’m interested in your library. I’m currently conducting related experiments, so I might use it.

2 Likes

Using

lib_deps =
  rlogiacco/Battery Sense @ ^1.2.0

works absolutely fine. No build errors. Tested on Windows 11 and Ubuntu 26.04

What exact errors do you encouter?
Please post the error messages!

However, you should add a library manifest (library.json) to your library and fix the file structure.
For more information, please see Creating Library — PlatformIO latest documentation and my pull request.

2 Likes

So, apparently it must have been an issue in my workspace: after your reports of “no problem” I re-created the whole workspace and I had no issues…
Thanks to everyonw who took the time to help and also for the advice on the library.

1 Like