Compiling error on webeditor that parses fine on desktop version

Hi All,

I have added a LCD board to a project and was playing around with it on a nano that i was uploading to using the desktop editor, here is the opening code i use for that:

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x27 // <<----- Add your address here.  Find it from I2C Scanner
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

I use a identical one for the mega on the web editor:

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x27 // <<----- Add your address here.  Find it from I2C Scanner
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

however when i compile the version on the web editor i get the following error:

/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::available()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::rxBufferLength'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::rxBufferIndex'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::read()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::rxBuffer'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::peek()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::flush()'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::onReceiveService(unsigned char*, int)'
/tmp/291922641/build/libraries/Wire/Wire.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/291922641/build/libraries/jm_wire-1-0-1/jm_Wire.cpp.o (symbol from plugin): In function `TwoWire::available()':
(.text+0x0): multiple definition of `TwoWire::user_onReceive'

and more but that takes it over the 9000 chracter limit!!

Has anyone any idea a) why and b) how i fix it please?

I have googled the error, but i confess i could not see how to fix it as it said about removing libraries etc, i have not added any libraries.

Many thanks

I do notice that if you remove the line #include <Wire.h> from your sketch it will compile on the Arduino Web Editor.

I believe the real problem is that you are actually using a different LiquidCrystal_I2C library on Arduino Web Editor than you are when compiling with the desktop version. There are multiple libraries of that name and you have no guarantee the one installed in the Arduino Web Editor is the same one your code was written for.

Post a link to where you got the LiquidCrystal_I2C library from. Please use the chain links icon on the toolbar to make it clickable. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

Sorry yes, i should have said t compiles fine without that.

I did not add libraries, those were picked up by the code, I have not added any libraries to either the web or the desktop version.

JonMiles:
I have not added any libraries to either the web or the desktop version.

The Arduino IDE does not come with the LiquidCrystal_I2C library so the only way that sketch could compile for you on the desktop version is if you had installed the library.

pert:
The Arduino IDE does not come with the LiquidCrystal_I2C library so the only way that sketch could compile for you on the desktop version is if you had installed the library.

Sorry, don't know what to tell you, I have never added any libraries to either the desktop or web editor.

@JonMiles

May you please:

  1. Enable "Show verbose output during: [ x ] compilation" from the Desktop IDE preferences
  2. build the sketch with #include <Wire.h>
  3. copy & paste the console output here