Go Down

Topic: own library with compile error at include <Wire.h> No such file nor directory (Read 739 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.


Go Up