16 x 2 LCD and library/compile errors?

Hi all,

I am trying to get the Liquid crystal library to work but am failing. I have created a new app, named and saved it. Added the liquid crystal library by selecting it to include in my app, choosing my app. The IDE then inserts a #include

When I cut out the example code in the library (hello sparkey.cpp) and paste it into my .ino code tab it will not compile. My code is …


#include "LiquidCrystal.h"

// Make sure to update these to match how you've wired your pins.
// pinout on LCD [RS, EN, D4, D5, D6, D7];
// pin nums LCD  [ 4,  6, 11, 12, 13, 14];
// Shield Shield [RS, EN, D4, D5, D6, D7];
// Spark Core    [D3, D5, D2, D4, D7, D8];
LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16,2);
  // Print a message to the LCD.
  lcd.print("Hello, Sparky!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:

}
the errors is....
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from LiquidCrystal/LiquidCrystal.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:37:0,
from ../inc/application.h:29,
from LiquidCrystal/LiquidCrystal.cpp:1:
../inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
../inc/spark_wiring_ipaddress.h:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
../inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
../inc/spark_wiring_ipaddress.h:54:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
../inc/spark_wiring_ipaddress.h:54:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from lcd_time1.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
lcd_time1.cpp:45:27: fatal error: LiquidCrystal.h: No such file or directory
This example code is in the public domain.
^
compilation terminated.
make: *** [lcd_time1.o] Error 1

Error: Could not compile. Please review your code.

Any suggestions / ideas / solutions welcome.

1 Like

Im trying to work out what you actually have in your web IDE, is there 3 tabs up the top?

if not{
Adding the #include LiquidCrystal.h does not automatically add the actual library or tell the compiler whats in code of the library, it just says you “need this code in this file”

in the Web IDE you will see a little plus in the top right corner, you will need to add the library contents into a new set of tabs.
}
else if true{
there is a strange line

lcd_time1.cpp:45:27: fatal error: LiquidCrystal.h: No such file or directory
This example code is in the public domain. <<< this one
^

is there a comment double forward-slash missing at the start of the file?
}

1 Like

@Julian,

You will need to include the library from the Libraries tab.

The Web IDE works a little different from the normal Arduino IDE environment :wink:

1 Like

Hi @Hootie81, @kennethlimcp,

Thank you for your quick message.

Hootie81, you are quite correct I have not put the three tabs from the library into the app’s “workbook”. When I read about the new library feature I thoght that by hitting the “add library to app” button and then choosing the app to use the library in actually added the library. From what you are saying, the above actions just add one line of code - “include…”. I thought that the library was added “in the background” like an arduino. I can see the advantage of having it in the open so that advanced users can tinker with it. For me, I just want that library of commands as simply as possible.

The bit I don’t get with the new feature is why, if you have chosen to add the library to your code, would you not want it adding completely by the IDE?

When adding the other library tabs to your app code - what method do you use? copy and paste?

Thank you very much for your answers.

1 Like

There’s 2 methods now.

1.) Included libraries ported to :spark: and simply add it to your App

2.) Create the .h and .cpp files for the library in the App itself for libraries not ported to :spark:

So you are right about copying and pasting (with some modifications usually :p)

Hi @kennethlimcp, @Hootie81,

Thank you for your patience. I appreciate it. OK still having a problem but having lots of fun :smile:

I have started a new app, imported the LiquidCrystal library by selecting the liquid crystal library pressing the "import this library"button. Then manually added (by pressing the white button in the top right of the IDE to get .cpp and.h blank tabs and then renaming,cutting and pasting the .cpp and .h files from the library code) the LiquidCrystal.cpp and liquidCrystal.h.

So I am currently as shown in the screen shot above. I have also copied and pasted the “spark-hello sparkey.cpp” code and pasted it into my .ino tab.

And breath!! Lol

This will not compile.

I am missing something pretty basic but I can not put my finger on it. I am determined not to be beaten by this ;).

Any advice you can give is most welcome.

Thank you very much :slight_smile:

what does the compile error say?

@Hootie81

Super quick :wink:

  In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from LiquidCrystal/LiquidCrystal.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:37:0,
from ../inc/application.h:29,
from LiquidCrystal/LiquidCrystal.cpp:1:
../inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
../inc/spark_wiring_ipaddress.h:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
../inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
../inc/spark_wiring_ipaddress.h:54:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
../inc/spark_wiring_ipaddress.h:54:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from LiquidCrystal.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:37:0,
from ../inc/application.h:29,
from LiquidCrystal.cpp:1:
../inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
../inc/spark_wiring_ipaddress.h:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
../inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
../inc/spark_wiring_ipaddress.h:54:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
../inc/spark_wiring_ipaddress.h:54:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from lcd_time.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:37:0,
from ../inc/application.h:29,
from lcd_time.cpp:1:
../inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
../inc/spark_wiring_ipaddress.h:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
../inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
../inc/spark_wiring_ipaddress.h:54:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
../inc/spark_wiring_ipaddress.h:54:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
LiquidCrystal.o: In function `LiquidCrystal::begin(unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:24: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:24: first defined here
LiquidCrystal.o: In function `LiquidCrystal::begin(unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:24: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:24: first defined here
LiquidCrystal.o: In function `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:31: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:31: first defined here
LiquidCrystal.o: In function `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:31: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:31: first defined here
LiquidCrystal.o: In function `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:38: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:38: first defined here
LiquidCrystal.o: In function `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:38: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:38: first defined here
LiquidCrystal.o: In function `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:44: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:44: first defined here
LiquidCrystal.o: In function `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:44: multiple definition of `LiquidCrystal::LiquidCrystal(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:44: first defined here
LiquidCrystal.o: In function `LiquidCrystal::init(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:55: multiple definition of `LiquidCrystal::init(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:55: first defined here
LiquidCrystal.o: In function `LiquidCrystal::pulseEnable()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:256: multiple definition of `LiquidCrystal::pulseEnable()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:256: first defined here
LiquidCrystal.o: In function `LiquidCrystal::write4bits(unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:265: multiple definition of `LiquidCrystal::write4bits(unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:265: first defined here
LiquidCrystal.o: In function `LiquidCrystal::write8bits(unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:273: multiple definition of `LiquidCrystal::write8bits(unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:273: first defined here
LiquidCrystal.o: In function `LiquidCrystal::send(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:240: multiple definition of `LiquidCrystal::send(unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:240: first defined here
LiquidCrystal.o: In function `LiquidCrystal::clear()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:134: multiple definition of `LiquidCrystal::clear()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:134: first defined here
LiquidCrystal.o: In function `LiquidCrystal::home()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:140: multiple definition of `LiquidCrystal::home()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:140: first defined here
LiquidCrystal.o: In function `LiquidCrystal::begin(unsigned char, unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:76: multiple definition of `LiquidCrystal::begin(unsigned char, unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:76: first defined here
LiquidCrystal.o: In function `LiquidCrystal::setCursor(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:146: multiple definition of `LiquidCrystal::setCursor(unsigned char, unsigned char)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:146: first defined here
LiquidCrystal.o: In function `LiquidCrystal::noDisplay()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:155: multiple definition of `LiquidCrystal::noDisplay()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:155: first defined here
LiquidCrystal.o: In function `LiquidCrystal::display()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:159: multiple definition of `LiquidCrystal::display()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:159: first defined here
LiquidCrystal.o: In function `LiquidCrystal::noCursor()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:165: multiple definition of `LiquidCrystal::noCursor()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:165: first defined here
LiquidCrystal.o: In function `LiquidCrystal::cursor()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:169: multiple definition of `LiquidCrystal::cursor()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:169: first defined here
LiquidCrystal.o: In function `LiquidCrystal::noBlink()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:175: multiple definition of `LiquidCrystal::noBlink()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:175: first defined here
LiquidCrystal.o: In function `LiquidCrystal::blink()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:179: multiple definition of `LiquidCrystal::blink()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:179: first defined here
LiquidCrystal.o: In function `LiquidCrystal::scrollDisplayLeft()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:185: multiple definition of `LiquidCrystal::scrollDisplayLeft()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:185: first defined here
LiquidCrystal.o: In function `LiquidCrystal::scrollDisplayRight()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:188: multiple definition of `LiquidCrystal::scrollDisplayRight()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:188: first defined here
LiquidCrystal.o: In function `LiquidCrystal::leftToRight()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:193: multiple definition of `LiquidCrystal::leftToRight()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:193: first defined here
LiquidCrystal.o: In function `LiquidCrystal::rightToLeft()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:199: multiple definition of `LiquidCrystal::rightToLeft()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:199: first defined here
LiquidCrystal.o: In function `LiquidCrystal::autoscroll()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:205: multiple definition of `LiquidCrystal::autoscroll()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:205: first defined here
LiquidCrystal.o: In function `LiquidCrystal::noAutoscroll()':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:211: multiple definition of `LiquidCrystal::noAutoscroll()'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:211: first defined here
LiquidCrystal.o: In function `LiquidCrystal::createChar(unsigned char, unsigned char*)':
/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal.cpp:220: multiple definition of `LiquidCrystal::createChar(unsigned char, unsigned char*)'
LiquidCrystal/LiquidCrystal.o:/spark/compile_server/shared/workspace/worker_2/core-firmware/build/LiquidCrystal/LiquidCrystal.cpp:220: first defined here
collect2: error: ld returned 1 exit status
make: *** [f13abd3be5c2c8148100a1cc2df891f61ac828124d45716f542a7a83abb2.elf] Error 1

Wow that was loner than I thought.

Hey @Julian,

If you use a library that is already available in the Web IDE, there is no need to manually copy and paste the library files.

A #include statement will be added to your code and done!

Try removing all the ``` .h and .cpp` files you added :slight_smile:

1 Like

sorry, i miss read your first post and got confused! i didn’t realize you had selected to use the library, i thought you just added the include line yourself

error in the first code is probably a missing #include “application.h”

2 Likes

Hey @kennethlimcp, @Hootie81,

Thanks guys, but no better I am afraid. I have deleted the old app and started again. including the Liquid crystal library and cutting the code from the hello sparky example.

My error still seems huge.

I checked the code and the #include “application.h” is in there at the top.

Thanks for your help.

try changing the order of the two includes at the top

application.h first

1 Like

@Julian, @Hootie81, I have to chime in here! There is an issue with libraries that were posted before some of the recent changes to the library system. This affects how libraries are referenced in your .ino file.

To make everything work with the example, you need to change the line:

#include "LiquidCrystal.h"  to

#include "LiquidCrystal/LiquidCrystal.h"

This would apply to any library you would reference in your code. Let me know how it goes :smile:

2 Likes

Hey @Hootie81, @peekay123, Thank you for your help. The #include was already changed to “LiquidCrystal/LiquidCristal.h” I changed the order of the includes to put the #application.h first and …

hey presto, the code now compiles fine.

Thank you very much for your help.

2 Likes