Go Down

Topic: own library with compile error at include <Wire.h> No such file nor directory (Read 16011 times) previous topic - next topic

transistortoaster

Hello,
I'm using Arduino 1.5.8 on Windows 7 for Due. My own library that I put in C:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest\ does not compile because it can't find the Wire.h. How do I fix that?
Advice please,
Thanks,
Frank

Less verbose compilation error:
Quote
C:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest\Simpletest.cpp:1:18: fatal error: Wire.h: No such file or directory
 #include <Wire.h>
                  ^
compilation terminated.
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Simpletest.cpp
Code: [Select]

#include <Wire.h>
#include "Simpletest.h" 
#include "arduino.h"

void printHello(){
    Serial.print ("hello");
}


Simpletest.h
Code: [Select]

#ifndef SIMPLETEST_H_
#define SIMPLETEST_H_

void printHello();
#endif


test_simpletest_library.ino
Code: [Select]

#include <Simpletest.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}


More verbose compilation error:
Quote
Arduino: 1.5.8 (Windows 7), Board: "Arduino Due (Programming Port)"

Build options changed, rebuilding all

Using library Simpletest in folder: C:\Users\feory\Documents\Arduino\libraries\Simpletest (legacy)



C:\Program Files (x86)\Arduino/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\system/libsam -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\system/CMSIS/CMSIS/Include/ -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\system/CMSIS/Device/ATMEL/ -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\variants\arduino_due_x -IC:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest C:\Users\MYUSERNAME\AppData\Local\Temp\build511408871895859710.tmp\test_simpletest_library.cpp -o C:\Users\MYUSERNAME\AppData\Local\Temp\build511408871895859710.tmp\test_simpletest_library.cpp.o

C:\Program Files (x86)\Arduino/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\system/libsam -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\system/CMSIS/CMSIS/Include/ -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\system/CMSIS/Device/ATMEL/ -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\sam\variants\arduino_due_x -IC:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest -IC:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest\utility C:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest\Simpletest.cpp -o C:\Users\MYUSERNAME\AppData\Local\Temp\build511408871895859710.tmp\Simpletest\Simpletest.cpp.o

C:\Users\MYUSERNAME\Documents\Arduino\libraries\Simpletest\Simpletest.cpp:1:18: fatal error: Wire.h: No such file or directory
 #include <Wire.h>
                  ^
compilation terminated.
Error compiling.

transistortoaster

I found at http://forum.arduino.cc/index.php?topic=204465.0 post #2  that if I add #include <Wire.h> in the test_simpletest_library.ino at the very top, it compiles.


wucharinton

I got the same problem both home and in the office, no eeprom.h, no wire.h  no such that file in folder or directory when i replaced the backup libraries into the present libraries latest version or higher instead of copy contained files into its,It is might be different version of IDE????  but don't matter,

Here was my procedures to solved this problem.
1. delete the Arduino in my documents/arduino, backup libraries is required.
2. set yours sketch to C:\Users\Administrator\Documents\Arduino
3. Load LED blinking to test IDE. This will create Arduino & Libraries to C:\Users\Administrator\Documents\Arduino\Libraries
4. copy contained files in your backup libraries to new libraries



pjrc

Hello,
I'm using Arduino 1.5.8....
Perhaps try a newer version?

Arduino's ability to locate .h files has vastly improved, especially recently starting with 1.6.6.

igorsoares

Hello guys, I'm new here I and had the same problem. I'm using Arduino 1.6.9 and I solved this problem simply by moving the Wire.h file from the src folder (C:\...\Arduino\hardware\arduino\avr\libraries\Wire\src\Wire.h) to the Wire folder (C:\...\...\Wire). I hope this could help you :)

Go Up