[Solved] Problem with wire.h when using custom libs.

I give up! =( I need help now. Please help me why im gettings these errors. Im new here :slight_smile:
Its a library for getting sensor values from a MPU6050 6 DOF.

project.ino

#include "IMU.h"
IMU imuController;

void setup() {
  imuController.init();
...

IMU.h

#include "Wire.h"
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
class IMU {
public:
	IMU();
...

MPU6050_6Axis_MotionApps20.h

I2C_Dev

errors:

/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:278: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:284: error: 'class TwoWire' has no member named 'read'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:418: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:427: error: 'class TwoWire' has no member named 'read'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:430: error: 'class TwoWire' has no member named 'read'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static bool I2Cdev::writeBytes(uint8_t, uint8_t, uint8_t, uint8_t*)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:601: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:607: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static bool I2Cdev::writeWords(uint8_t, uint8_t, uint8_t, uint16_t*)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:651: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:658: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:659: error: 'class TwoWire' has no member named 'write'

File structure:

changed:

#define I2CDEV_IMPLEMENTATION       I2CDEV_ARDUINO_WIRE

to

#define I2CDEV_IMPLEMENTATION       I2CDEV_ARDUINO0_WIRE

errors:

/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:24:19: error: twi.h: No such file or directory
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::begin()':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:60: error: 'twi_init' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::begin(uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:65: error: 'twi_setAddress' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:66: error: 'twi_attachSlaveTxEvent' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:67: error: 'twi_attachSlaveRxEvent' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:83: error: 'twi_readFrom' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'uint8_t TwoWire::endTransmission()':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:115: error: 'twi_writeTo' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::send(uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:143: error: 'twi_transmit' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::send(uint8_t*, uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:160: error: 'twi_transmit' was not declared in this scope

There is a copy, in your directory, of the Arduino core library composed of Wire.cpp and Wire.h. You need to either get rid of them and possibly break that library, or get rid of the core Wire library and possibly break other sketches.

Problem solved. Thank you :smiley:

Can i ask how do you go about breaking the copy of the library or getting rid of it?
I was trying this stuff too and I encounter this problem,however it cant be resolved. Please help

I have the same problem. Should i remove the Wire library from the Arduino's libraries folder?