What is going on with the libraries?

Ive uninstalled IDE once last week because of this same issue and already having the same exact issue this week. Just from 3 sketches alone, I have almost a gb of libraries and thats from using the libraries, compiling, getting an error "No such file or directory", go through the library, find what the problem is, hunt down another library on github that has it only for that to need a library, etc, etc, etc. Im using the right board, just pushed a code to it yesterday that worked and reflashed it just now after getting the error on another and it worked fine. EX. "Mouse.h" calls out "HID.h" as does controller and keyboard. No HID.h to be found anywhere now, look at the readme and it says "You need the HID.h, fopr more info go to https://docs.arduino.cc/language-reference/en/functions/usb/mouse/ for more info. Okay, go there and the links dead, then spend an hour trying to find another, downloading various libraries. This is literally just about every sketch I come across or any library I use. Its almost like if you arent going to write every line of it you may as well not even try. When I first started using this I loved it, now its gotten to the point I dont even want to open it anymore.



Hi @jayw5665.

HID.h is part of the "HID" library. Because it is very architecture-specific (meaning the low level implementation code in the library is completely different from one board family to another), the library is bundled with the boards platform you install via Boards Manager, rather than being a standalone library you would install via Library Manager.

Not all boards platforms have an "HID" library. If you are getting an error about HID.h, this indicates you are using a board from a platform that does not have an "HID" library. So please tell us which board you are using.

Are you using the Library Manager? The reason I ask is it knows about dependencies and will automatically download any.

Post the code you are trying to compile so we can test it. In code tags.

This is true, but it is only possible when the dependency is available for installation via Library Manager.

In cases like this when the dependency is a "platform bundled" library, Library Manager can't install the dependency. In practice, this limitation isn't really an issue because you will already have the board's platform installed. So if you are using a compatible board then the dependency will already be available, and if you aren't using a compatible board then there is no hope to use the library anyway and the only way forward will be to find a compatible library.

1 Like

As I understand it OP's problem is not about the HID functionality; it's about the access to https://docs.arduino.cc/language-reference/en/functions/usb/mouse/. OP's screenshot shows this and I can confirm that that direct link gives the error.

@jayw5665

You can access the mouse library through https://docs.arduino.cc/language-reference/; search for mouse and click the link.

Note the difference in the URL when using this approach; the link through the reference main page has a capital M (for mouse), your one has a lowercase m.

https://docs.arduino.cc/language-reference/en/functions/usb/Mouse/
https://docs.arduino.cc/language-reference/en/functions/usb/mouse/