Library headers not found

Several libraries installed via manage libraries. I can see them under /libraries in my sketch folder. Properly structured with headers under /src. IDE lists them as installed libraries.

In my sketch, both #include "lib.h" or <lib.h> fails for all libraries. "no such file or directory".

Help !!

I shouldn't have to copy library headers into my sketch file folder, right?

thx

K

What libraries? What board? Compiler output?

Check prefs, what does it say for Sketch folder. The library folder has to be under the sketch folder.

Preferences have sketchbook location as
sketches are under c:\users*\dropbox\arduino
libraries under c:\users*\dropbox\arduino\libraries, which is where Arduino put them

It may be dropbox is causing the problem, try moving your sketch folder to local storage. I use Msft OneDrive, but not all cloud based solutions work with the IDE.

Hi @kmanuele.

Do you have a file named library.properties in the root of the library folders?

When you put the source code files under the src subfolder, this is what is known as the "1.5" library format. When you use this layout, it is mandatory to add a library.properties metadata file to the root of the library folder (libraries/lib/library.properties). If you don't do that, the Arduino library discovery system won't recognize the folder as an Arduino library and thus won't find the header file in the src subfolder.

You can learn what you need to put in a library.properties metadata file here:

https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata


If you don't want to mess with adding a library.properties metadata file, simply use the "1.0" library format (where a library.properties file is optional) by moving the header file to the root of the library folder (libraries/lib/lib.h).

1 Like

It's there, if you can see this screen shot

image

Note that I didn't put them there, Arduino did. I just added the libraries via the IDE manage libraries actions. IDE version 2.3.2.

Thanks, but it is local storage on my C: drive. It only gets sync'd up to dropbox cloud periodically. I think different behavior than OneDrive (which is why I stopped using it).

It would be a serious problem if this doesn't work.

K

So all your sketches are under Arduino? Here is my layout.
Pic 1 shows Arduino which is what my prefs say
and pic 2 shows all my sketch folders



If you have something similar, then it's Dropbox somehow interfering.

What's behind the star? If there are any non-latin characters in the username then that can cause issues too.

just for privacy/security in forums. The file names and structures are valid.

Arduino folder with folders for each sketch, and the library folder.

If dropbox is the problem, then how to folks write code in the office and then compile/upload in the shop where the tools are?

I do this all the time with these sketches (compile/upload from my laptop), except only recently tried incorporating libraries.

K

That looks correct. I only threw out dropbox because it was different than a local drive. Now that the directories all appear correct, is it working? Does your Sketchbook Location in the Settings look similar to the following?


As you can see I too am using a cloud service and I know it has issues as we discussed here last week or so, I do NOT know that dropbox does, but it is different.
Just to be clear, you are working now?

My OneDrive is configured to store ALL files on my 1TB SSD. In it's spare time it copies changes up to the cloud.

dropbox too, as default behavior. I can disconnect from 'net and still access.

Though it does have options for online storage only.

K

The libraries always looked correct. Still not working -- with libraries. The sketches all compile and load without problem.

Going to reinstall IDE, hopefully.

Unfortunately some paths that are valid in the filesystem are not supported by the Arduino development tools. So we do need you to tell us whether your "c:\users*\dropbox\arduino" path contains any characters other than the basic ASCII (e.g., a-z, A-Z, 0-9).

there is no '*'. I included it for privacy reasons in these (and any other) forums.

K

Yes, we all understand that very well.

You need to provide the information that has already been requested twice if you want further assistance:

You don't need to tell us what the path is, only whether it contains any non-ASCII characters (e.g., мікроконтролер).

The ball is in your court. If you won't answer our questions then there is nothing more we can do to help you and you are on your own to solve the problem.

1 Like

reinstall didn't work.

can compile all the sketches, but still can't access library headers.

-- even if I disconnect from 'net -- so only local file access is possible.

K