Third-party library problem


#1

I want to include library “src/Adafruit_GFX.h” and “src/Adafruit_SSD1306.h” into mblock 5 but have some error when upload it.

I received this message.
2222
start processing code…

avr-toolchain\bin\avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\avr-library\variants\eightanaloginputs" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/src/utility" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/utility/" -I"arduino-libraries/arduino/Esplora/src/" -I"arduino-libraries/arduino/Firmata/" -I"arduino-libraries/arduino/Firmata/utility/" -I"arduino-libraries/arduino/Keyboard/src/" -I"arduino-libraries/arduino/Mouse/src/" -I"arduino-libraries/arduino/Robot_Control/src/" -I"arduino-libraries/arduino/Robot_Motor/src/" -I"arduino-libraries/arduino/RobotIRremote/src/" -I"arduino-libraries/arduino/Stepper/src/" “C:\Users\Admin\mblock-avr\temp\build\src\JituBotz_Micro.cpp” -o “C:\Users\Admin\mblock-avr\temp\build\src\JituBotz_Micro.o”

avr-toolchain\bin\avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\avr-library\variants\eightanaloginputs" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/src/utility" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/utility/" -I"arduino-libraries/arduino/Esplora/src/" -I"arduino-libraries/arduino/Firmata/" -I"arduino-libraries/arduino/Firmata/utility/" -I"arduino-libraries/arduino/Keyboard/src/" -I"arduino-libraries/arduino/Mouse/src/" -I"arduino-libraries/arduino/Robot_Control/src/" -I"arduino-libraries/arduino/Robot_Motor/src/" -I"arduino-libraries/arduino/RobotIRremote/src/" -I"arduino-libraries/arduino/Stepper/src/" “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_GFX.cpp” -o “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_GFX.o”

avr-toolchain\bin\avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\avr-library\variants\eightanaloginputs" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/src/utility" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/utility/" -I"arduino-libraries/arduino/Esplora/src/" -I"arduino-libraries/arduino/Firmata/" -I"arduino-libraries/arduino/Firmata/utility/" -I"arduino-libraries/arduino/Keyboard/src/" -I"arduino-libraries/arduino/Mouse/src/" -I"arduino-libraries/arduino/Robot_Control/src/" -I"arduino-libraries/arduino/Robot_Motor/src/" -I"arduino-libraries/arduino/RobotIRremote/src/" -I"arduino-libraries/arduino/Stepper/src/" “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.cpp” -o “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.o”

avr-toolchain\bin\avr-g++ -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\avr-library\variants\eightanaloginputs" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src" -I"arduino-libraries/makeblock/src/utility/avr" -I"avr-library/libraries/Wire/src/utility" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/" -I"arduino-libraries/arduino/Adafruit_Circuit_Playground/utility/" -I"arduino-libraries/arduino/Esplora/src/" -I"arduino-libraries/arduino/Firmata/" -I"arduino-libraries/arduino/Firmata/utility/" -I"arduino-libraries/arduino/Keyboard/src/" -I"arduino-libraries/arduino/Mouse/src/" -I"arduino-libraries/arduino/Robot_Control/src/" -I"arduino-libraries/arduino/Robot_Motor/src/" -I"arduino-libraries/arduino/RobotIRremote/src/" -I"arduino-libraries/arduino/Stepper/src/" “C:\Users\Admin\mblock-avr\temp\build\code.cpp” -o “C:\Users\Admin\mblock-avr\temp\build\code.o”

avr-toolchain\bin\avr-gcc -w -Os -Wl,–gc-sections -mmcu=atmega328p -o “C:\Users\Admin\mblock-avr\temp\build\out.elf” “C:\Users\Admin\mblock-avr\temp\build\src\JituBotz_Micro.o” “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_GFX.o” “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.o” “C:\Users\Admin\mblock-avr\temp\build\code.o” “C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\nano\libnano.a” -lm

Command failed: avr-toolchain\bin\avr-gcc -w -Os -Wl,–gc-sections -mmcu=atmega328p -o “C:\Users\Admin\mblock-avr\temp\build\out.elf” “C:\Users\Admin\mblock-avr\temp\build\src\JituBotz_Micro.o” “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_GFX.o” “C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.o” “C:\Users\Admin\mblock-avr\temp\build\code.o” “C:\Users\Public\Programs\mblock\resources\app\mlink-v1\external\arduino\nano\libnano.a” -lm C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.o: In function SPIClass::beginTransaction(SPISettings)': C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference toSPIClass::interruptMode’ C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference to SPIClass::interruptMode' C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference toSPIClass::interruptSave’ C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference to SPIClass::interruptMask' C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference toSPIClass::interruptSave’ C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.o: In function SPIClass::endTransaction()': C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference toSPIClass::interruptMode’ C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference to SPIClass::interruptMode' C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference toSPIClass::interruptSave’ C:\Users\Admin\mblock-avr\temp\build\src\Adafruit_SSD1306.o: In function Adafruit_SSD1306::begin(unsigned char, unsigned char, bool, bool)': C:\Users\Admin\mblock-avr\temp\build\src/Adafruit_SSD1306.cpp:915: undefined reference toSPIClass::begin()’ collect2.exe: error: ld returned 1 exit status

arduino build failed.

what 's the problem?


#2

Hi adyfati,

How about use <src/Adafruit_GFX.h> and <src/Adafruit_SSD1306.h> have a try?


#3

I have already try but the result is the same. Thank you for the response. I just solve the problem by add SPI library.