No such file or directory

I’m trying to program my IRremote, and to do that I need to #include <IRremote.h>

I get the error message: “No such file or directory”

#include <IRremote.h>
#define Button_1 0xFF6897
#define Button_2 0xFF9867
int receiver = 13;
IRrecv irrecv(receiver);
decode_results results;

void setup(){

void loop(){
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

I downloaded "Arduino-IRremote-master" and I can visibly see the document I'm looking for in the file. For some reason, my arduino code won't recognize it.

But did you ever install the library? When you use the #include <IRremote.h> syntax, the library must be installed to one of the libraries folders. When you do an installation via Library Manager or Add .ZIP Library, the Arduino IDE automatically installs the library to the correct folder. If you manually install the library then you must make sure to put it in the correct location (as described by the link in my previous reply.

If you want to include a file that’s in the sketch folder then you must use the #include “IRremote.h” syntax.

I'm very new to this.

This is what I used to download Arduino-IRremote-master. What else do I have to do?

Please take the time to read the official instructions for installing libraries. This is an extremely important skill for any Arduino user:

This is how you would install a library you downloaded from GitHub:

  • Go to the home page of the GitHub repository.
  • Click on the Releases tab.
  • On the release version you want, click “Source Code (zip)”.
  • (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library
  • Select the downloaded file.
  • Click “Open”

You can also download the library via “Clone or Download > Download ZIP” on the home page, but that will give you the library version at it’s latest development state, which is only intended for beta testing. So I recommend only using release versions of the library. In some cases, the library author will not have made any releases and in that case you have no choice but to use the “Clone or Download > Download ZIP” version.

However, in this particular case, there is an even easier and better installation option because the IRremote library is available in the Library Manager. So I would recommend that, instead of following the above instructions, you install it like this:

  • Sketch > Include Library > Manage Libraries…
  • Wait for the download to finish.
  • In the “Filter your search…” box, type: irremote
  • In the search results, click on “IRremote by shirriff”.
  • Click “Install”.
  • Wait for the installation to finish.
  • Click “Close”.

Not all libraries are available in Library Manager so it’s still valuable to understand how to do an “Add .ZIP Library” installation. You can also do a manual installation (as recommended in the IRremote library’s installation instructions) but I recommend against that unless you have no other choice because the other two installation options will make sure that the library is correctly installed.

Thanks a lot, you’re a huge help.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!