5

Here's the code that's making this error:

#include "Wire.h"

Here's the error:

fatal error: Wire.h: No such file or directory
 #include "Wire.h"
                  ^
compilation terminated.
Error compiling.

I'm also can't include any file from my Arduino\libraries folder. I tried to reinstall the IDE several times in different places and nothing happened. Why is this happening?

EDIT: after some time I discovered that this error occurs in header files only, not in sketches!

  • Could you clarify a little more on your setup of the IDE and the full paths to those libraries and if you have any duplicates. Also what is the settings you chose in the Boards menu. – RSM Jun 28 '16 at 7:58
  • D:\Arduino\hardware\arduino\avr\libraries\Wire\Wire.h And I chose the Arduino Uno COM3 – None Jun 28 '16 at 8:03
  • Is the library there header there(I know its an obvious ques). That is where the arduino system should be looking when UNO is chosen – RSM Jun 28 '16 at 8:08
  • yes it is there – None Jun 28 '16 at 8:45
  • 1
    Change it from #include "Wire.h" to #include <Wire.h> – Majenko Jun 28 '16 at 13:11
1

Use #include <Wire.h>

Including files in double quotes (") will point to headers in current working directory first.

Edit: ... and there is nothing wrong with copying headers to CWD if you are modifying them, but that's probably not what you want.

-1

First go to your library folder and check whether u included that Wire.h header file or not.If not then first include that file then problem will get solved automatically.

  • The line that is causing the problem in the include statement, the one you think will fix it. If that's not what you mean please can you clarify your answer? – Code Gorilla Jul 27 '16 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.