0

When I add Arduino's own library to two projects, one of them successfully compiling, one of them not. What the reason is? I can't figure out.

Keypad.h:6:27: fatal error: OnewireKeypad.h: No such file or directory
 #include <OnewireKeypad.h>
                           ^
compilation terminated.
Error compiling.

Compiled with error: No such file or directory

Compiled succesfful

Emir Onuk
  • 1
  • 1

1 Answers1

0

Most likely:

You need to include any library you use in your sketch (even if it is used in another file also). This is so the IDE can copy it to the temp directory. So you'll need #include <OnewireKeypad.h> in your Keypad.h and sketch file.

Something else to try:

Keypad is the name of a library (uses Keypad.h). If you have it installed, you may be grabbing this instead of your local sketch file.

Try renaming the file to something else like OWKeypad.h. Or you could try including it with quotes instead of angle brackets: include "file.h" instead of #include <file.h>.

Chris A
  • 1,475
  • 3
  • 18
  • 22
  • Thanks for your efforts. This is not answer of my question. I've already compiled by copy library to local directory. But I've just ask my question about why it has two different behaviour on two project with same library. – Emir Onuk Jan 02 '17 at 18:22
  • You do not show your sketch file, but I can almost guarantee I was right: "You need to include any library you use even if it is used in another file in the sketch file". I bet you do not have `#include ` in your sketch, only in `Keypad.h` – Chris A Jan 02 '17 at 20:54