# "HID.h: No such file or directory" with arduino leonardo

**URL:** <https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067>\
**Category:** IDE 1.x\
**Created:** [December 24, 2022, 1:00pm UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067 "2022-12-24T13:00:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesaudrino](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jamesaudrino](https://forum.arduino.cc/u/jamesaudrino)\
**Post date:** [December 24, 2022, 1:00pm UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/1 "2022-12-24T13:00:26Z")

</div>

I've tried everything.

> Arduino: 1.8.19 (Windows 10), Board: "Arduino Leonardo"
> 
> In file included from C:\Users\███\Desktop\███\███.ino:1:0:
> 
> C:\Users\███\Documents\Arduino\libraries\Mouse\src/Mouse.h:25:10: fatal error: HID.h: No such file or directory
> 
> #include "HID.h"
> 
> ```
> ^ ~~~~~~
> 
> ```
> 
> compilation terminated.
> 
> exit status 1
> 
> Error compiling for board Arduino Leonardo.

---

<div class="post-metadata">

**Author:** ![hasanthesyrian](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@hasanthesyrian](https://forum.arduino.cc/u/hasanthesyrian)\
**Post date:** [December 24, 2022, 1:03pm UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/2 "2022-12-24T13:03:05Z")

</div>

Try installing the library in your library directory.

> **[GitHub - arduino-libraries/USBHost: USB Host Library for Arduino](https://github.com/arduino-libraries/USBHost)**
>
> USB Host Library for Arduino. Contribute to arduino-libraries/USBHost development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![jamesaudrino](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jamesaudrino](https://forum.arduino.cc/u/jamesaudrino)\
**Post date:** [December 24, 2022, 1:09pm UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/3 "2022-12-24T13:09:59Z")

</div>

Ive tried installing the libary, and it does not work.

it also says on the github page:

> The USBHost library allows an **Arduino Due** board to appear as a USB host...

---

<div class="post-metadata">

**Author:** ![b707](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/b707/32/854321_2.png) [@b707](https://forum.arduino.cc/u/b707)\
**Post date:** [December 24, 2022, 2:21pm UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/4 "2022-12-24T14:21:26Z")

</div>

The library HID.h is a part of AVR-core Arduino libraries, you don't need to install it directly, it should be installed with Arduino IDE.  
The folder HID should be located in `\hardware\arduino\avr\libraries\` in your IDE install dir.

---

<div class="post-metadata">

**Author:** ![tranmarker](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tranmarker/32/926647_2.png) [@tranmarker](https://forum.arduino.cc/u/tranmarker)\
**Post date:** [March 2, 2023, 6:17am UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/5 "2023-03-02T06:17:05Z")

</div>

I have the same issue, but I cant find the root folder library? is it realy in the folder of the arduino?

---

<div class="post-metadata">

**Author:** ![b707](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/b707/32/854321_2.png) [@b707](https://forum.arduino.cc/u/b707)\
**Post date:** [March 2, 2023, 8:15am UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/6 "2023-03-02T08:15:47Z")

</div>

> [@tranmarker](#):
>
> I have the same issue

What arduino board do you use?

---

<div class="post-metadata">

**Author:** ![tranmarker](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tranmarker/32/926647_2.png) [@tranmarker](https://forum.arduino.cc/u/tranmarker)\
**Post date:** [March 12, 2023, 6:37am UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/7 "2023-03-12T06:37:40Z")

</div>

I didnt use an arduino board that could be the problem. So I bought an arduino with ATmega32u4 then it works. i used the UART to communicate but I got stuck because it didnt communicate. The solution was to use Serial1 not Serial to recieve data from an other board.

Thank you for your reply

---

<div class="post-metadata">

**Author:** ![jamesaudrino](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jamesaudrino](https://forum.arduino.cc/u/jamesaudrino)\
**Post date:** [March 12, 2023, 7:45am UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/8 "2023-03-12T07:45:47Z")

</div>

Hello! just a little follow-up. After removing the IDE from my computer and reinstalling an older version of the old one, everything worked. hope this helps someone.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 8, 2023, 7:46am UTC](https://forum.arduino.cc/t/hid-h-no-such-file-or-directory-with-arduino-leonardo/1069067/9 "2023-09-08T07:46:05Z")

</div>

Closed on September 8, 2023, 7:46am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
