Error compiling Adafruit_22d1306 example [SOLVED]

I got my sparkcore expecting the usage would be the same as arduino.
From the beginning I have had hard time using this.
Simple example like blinking led works fine but when I tried to use one of the examples which is included in the libraries on WEB IDE, it gives me error message.

ssd1306-128x64-i2c.ino

I tried to compile this and the error message shows that it could not find Adafruit_GFX.h.

Therefore, I manually copy and pasted .h and .c to my sketch.

But it still doesn’t work.

error message

In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from Adafruit_GFX.h:4,
from Adafruit_GFX.cpp:34:
../../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:30:0,
from ../inc/application.h:29,
from Adafruit_SSD1306/Adafruit_GFX.h:4,
from Adafruit_SSD1306/Adafruit_GFX.cpp:34:
../../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:30:0,
from ../inc/application.h:29,
from Adafruit_SSD1306/Adafruit_GFX.h:4,
from Adafruit_SSD1306/Adafruit_SSD1306.cpp:19:
../../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:30:0,
from ../inc/application.h:29,
from Adafruit_GFX.h:4,
from Adafruit_SSD1306.cpp:19:
../../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:30:0,
from ../inc/application.h:29,
from ssd1306_128x64_i2c.cpp:18:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawFastHLine(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.h:9: multiple definition of `Adafruit_GFX::drawLine(short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:420: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawRoundRect(short, short, short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:462: multiple definition of `Adafruit_GFX::drawRect(short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:462: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawFastVLine(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:470: multiple definition of `Adafruit_GFX::drawFastVLine(short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:470: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawFastHLine(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:476: multiple definition of `Adafruit_GFX::drawFastHLine(short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:476: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::fillRect(short, short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:482: multiple definition of `Adafruit_GFX::fillRect(short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:482: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::fillScreen(unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:489: multiple definition of `Adafruit_GFX::fillScreen(unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:489: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::invertDisplay(bool)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:727: multiple definition of `Adafruit_GFX::invertDisplay(bool)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:727: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::Adafruit_GFX(short, short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:297: multiple definition of `Adafruit_GFX::Adafruit_GFX(short, short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:297: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::Adafruit_GFX(short, short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:297: multiple definition of `Adafruit_GFX::Adafruit_GFX(short, short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:297: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawCircle(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:311: multiple definition of `Adafruit_GFX::drawCircle(short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:311: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawCircleHelper(short, short, short, unsigned char, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:345: multiple definition of `Adafruit_GFX::drawCircleHelper(short, short, short, unsigned char, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:345: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::fillCircleHelper(short, short, short, unsigned char, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:388: multiple definition of `Adafruit_GFX::fillCircleHelper(short, short, short, unsigned char, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:388: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::fillCircle(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:381: multiple definition of `Adafruit_GFX::fillCircle(short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:381: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawRoundRect(short, short, short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:495: multiple definition of `Adafruit_GFX::drawRoundRect(short, short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:495: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::fillRoundRect(short, short, short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:510: multiple definition of `Adafruit_GFX::fillRoundRect(short, short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:510: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawTriangle(short, short, short, short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:522: multiple definition of `Adafruit_GFX::drawTriangle(short, short, short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:522: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::fillTriangle(short, short, short, short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:531: multiple definition of `Adafruit_GFX::fillTriangle(short, short, short, short, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:531: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawBitmap(short, short, unsigned char const*, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:608: multiple definition of `Adafruit_GFX::drawBitmap(short, short, unsigned char const*, short, short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:608: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::drawChar(short, short, unsigned char, unsigned short, unsigned short, unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:641: multiple definition of `Adafruit_GFX::drawChar(short, short, unsigned char, unsigned short, unsigned short, unsigned char)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:641: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::write(unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:621: multiple definition of `Adafruit_GFX::write(unsigned char)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:621: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::setCursor(short, short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:675: multiple definition of `Adafruit_GFX::setCursor(short, short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:675: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::setTextSize(unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:680: multiple definition of `Adafruit_GFX::setTextSize(unsigned char)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:680: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::setTextColor(unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:686: multiple definition of `Adafruit_GFX::setTextColor(unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:686: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::setTextColor(unsigned short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:690: multiple definition of `Adafruit_GFX::setTextColor(unsigned short, unsigned short)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:690: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::setTextWrap(bool)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:695: multiple definition of `Adafruit_GFX::setTextWrap(bool)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:695: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::getRotation()':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:700: multiple definition of `Adafruit_GFX::getRotation()'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:700: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::setRotation(unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:703: multiple definition of `Adafruit_GFX::setRotation(unsigned char)'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:703: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::width()':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:721: multiple definition of `Adafruit_GFX::width()'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:721: first defined here
Adafruit_SSD1306/Adafruit_GFX.o: In function `Adafruit_GFX::height()':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_GFX.cpp:725: multiple definition of `Adafruit_GFX::height()'
Adafruit_GFX.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_GFX.cpp:725: first defined here
Adafruit_SSD1306/Adafruit_GFX.o:(.rodata+0x0): multiple definition of `vtable for Adafruit_GFX'
Adafruit_GFX.o:(.rodata+0x0): first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::drawFastHLine(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:459: multiple definition of `Adafruit_SSD1306::drawFastHLine(short, short, short, unsigned short)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:459: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::drawFastVLine(short, short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:528: multiple definition of `Adafruit_SSD1306::drawFastVLine(short, short, short, unsigned short)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:528: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::drawPixel(short, short, unsigned short)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:96: multiple definition of `Adafruit_SSD1306::drawPixel(short, short, unsigned short)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:96: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char, signed char, signed char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:124: multiple definition of `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char, signed char, signed char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:124: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char, signed char, signed char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:124: multiple definition of `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char, signed char, signed char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:124: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:134: multiple definition of `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:134: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:134: multiple definition of `Adafruit_SSD1306::Adafruit_SSD1306(signed char, signed char, signed char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:134: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::Adafruit_SSD1306(signed char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:142: multiple definition of `Adafruit_SSD1306::Adafruit_SSD1306(signed char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:142: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::Adafruit_SSD1306(signed char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:142: multiple definition of `Adafruit_SSD1306::Adafruit_SSD1306(signed char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:142: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::clearDisplay()':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:446: multiple definition of `Adafruit_SSD1306::clearDisplay()'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:446: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::ssd1306_command(unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:272: multiple definition of `Adafruit_SSD1306::ssd1306_command(unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:272: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::begin(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:149: multiple definition of `Adafruit_SSD1306::begin(unsigned char, unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:149: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::invertDisplay(unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:265: multiple definition of `Adafruit_SSD1306::invertDisplay(unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:265: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::startscrollright(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:297: multiple definition of `Adafruit_SSD1306::startscrollright(unsigned char, unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:297: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::startscrollleft(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:312: multiple definition of `Adafruit_SSD1306::startscrollleft(unsigned char, unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:312: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::startscrolldiagright(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:327: multiple definition of `Adafruit_SSD1306::startscrolldiagright(unsigned char, unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:327: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::startscrolldiagleft(unsigned char, unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:344: multiple definition of `Adafruit_SSD1306::startscrolldiagleft(unsigned char, unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:344: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::stopscroll()':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:358: multiple definition of `Adafruit_SSD1306::stopscroll()'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:358: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::dim(bool)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:364: multiple definition of `Adafruit_SSD1306::dim(bool)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:364: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::ssd1306_data(unsigned char)':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:382: multiple definition of `Adafruit_SSD1306::ssd1306_data(unsigned char)'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:382: first defined here
Adafruit_SSD1306.o: In function `Adafruit_SSD1306::display()':
/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306.cpp:403: multiple definition of `Adafruit_SSD1306::display()'
Adafruit_SSD1306/Adafruit_SSD1306.o:/spark/compile_server/shared/workspace/worker_1/core-firmware/build/Adafruit_SSD1306/Adafruit_SSD1306.cpp:403: first defined here
Adafruit_SSD1306.o:(.rodata+0x0): multiple definition of `vtable for Adafruit_SSD1306'
Adafruit_SSD1306/Adafruit_SSD1306.o:(.rodata+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [693a13dde7842f9428af166f40b67b14326c8926cb239665f5e42fce8e77.elf] Error 1

What am I doing wrong?

Another question is, what most people do when you program sparkcore, WEB IDE or local compile? In other word, what’s the easiest and best way to program this thing?

Hello @bananazx

Sorry to hear you’re having trouble. The libraries are not maintained by spark, so it’s best to contact the library author about any troubles you are having. (All libraries are hosted in github, so you can create an issue there to alert the library author to your problem.)

But you’re in luck! It looks like in this case it’s just a problem with the example code included with the library. After clicking “USE THIS EXAMPLE”, change this code at the top of the file:

#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306.h"

into

#include "Adafruit_SSD1306/Adafruit_GFX.h"
#include "Adafruit_SSD1306/Adafruit_SSD1306.h"

and the code should compile fine! :smile:

As to local or online development, starting with the online IDE is simplest - it’s as close to plug and play as you can get!

1 Like

Oh! It compiles like a charm. I will keep using online IDE. Thank you very much mdma. I really appreciate.

2 Likes

Hi all,

Not sure what I am doing wrong here. Same issue as above BUT still a problem despite using the new include statements as above:

Hope someone can assist.
many thanks if you can.
Steve

In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from Adafruit_SSD1306/Adafruit_GFX.h:4,
from Adafruit_SSD1306/Adafruit_GFX.cpp:34:
../../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:29:0,
from ../inc/application.h:29,
from Adafruit_SSD1306/Adafruit_GFX.h:4,
from Adafruit_SSD1306/Adafruit_SSD1306.cpp:19:
../../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:29:0,
from ../inc/application.h:29,
from ssd1306_128x64_i2c.cpp:18:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
./obj/src/spark_wiring_random.o: In function `randomSeed(unsigned int)':
/spark/compile_server/shared/workspace/2_compile-server2/core-firmware/build/../src/spark_wiring_random.cpp:5: multiple definition of `random(int)'
ssd1306_128x64_i2c.o:/spark/compile_server/shared/workspace/2_compile-server2/core-firmware/build/ssd1306_128x64_i2c.cpp:32: first defined here
collect2: error: ld returned 1 exit status
make: *** [1cb5be52f9e7a40b22092915820d08fc9d079d275be3e09148f16b6f4467.elf] Error 1

There’s no error in the text you pasted?

1 Like

Full details now in post
thanks
S

Hi! I get the same error… did you find the problem? Thx!

ok forget me… I just renamed the random routine to random2 in .ino file…