error [-Wunused-variable] U8glib

When trying to compile in ATOM 1.41.0 x 64 using a platformio ide extension, I receive an error [-Wunused-variable]. The file in question comes from Marlin Github “Marlin-bugfix-2.0.x”. I beleive the path is (Marlin-bugfix-2.0.x/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_sp.cpp). The exact error (which does not keep me from compiling successfully) is;
.pio\libdeps\LPC1768\U8glib-HAL_ID1932\src\clib\U8g_com_i2c.c:44:16: warning: ‘u8g_i2c_opt’ defined but not used [-Wunused-variable] static uint8_t u8g_i2c_opt; /* U8G_I2C_OPT_NO_ACK, SAM: U8G_I2C_OPT_DEV_1 */
The files compile successfully, but when trying to compile in Arduino Marlin with the Marlin.ino file, I receive the following error and cannot compile.

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"

D:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Rods account\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10810 -build-path C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461 -warnings=none -build-cache C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_cache_382076 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Rods account\Desktop\3D printer\Marlin-bugfix-2.0.x\Marlin\Marlin.ino
D:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware D:\Program Files (x86)\Arduino\hardware -tools D:\Program Files (x86)\Arduino\tools-builder -tools D:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries D:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Rods account\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10810 -build-path C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461 -warnings=none -build-cache C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_cache_382076 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Rods account\Desktop\3D printer\Marlin-bugfix-2.0.x\Marlin\Marlin.ino
Using board 'uno' from platform in folder: D:\Program
Using core 'arduino' from platform in folder: D:\Program
Detecting libraries used...
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\Marlin.ino.cpp" -o nul
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\HAL.cpp" -o nul
Error while detecting libraries included by C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\HAL.cpp
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\HAL_SPI.cpp" -o nul
Error while detecting libraries included by C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\HAL_SPI.cpp
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\MarlinSerial.cpp" -o nul
Error while detecting libraries included by C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\MarlinSerial.cpp
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\Servo.cpp" -o nul
Error while detecting libraries included by C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\Servo.cpp
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\fast_pwm.cpp" -o nul
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\fastio.cpp" -o nul
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\persistent_store_eeprom.cpp" -o nul
Error while detecting libraries included by C:\Users\RODSAC<del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\persistent_store_eeprom.cpp
"D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\RODSAC</del>1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\u8g_com_HAL_AVR_sw_spi.cpp" -o nul
Alternatives for U8glib.h: []
C:\Users\RODSAC~1\AppData\Local\Temp\arduino_build_534461\sketch\src\HAL\HAL_AVR\u8g_com_HAL_AVR_sw_spi.cpp:65:10: fatal error: U8glib.h: No such file or directory
ResolveLibrary(U8glib.h)

#include <U8glib.h>

-> candidates: [] ^~~~~~~~~~

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

I have deleted and redownloaded the github version and recompiled in ATOM platformio IDE and no longer receive the error: (.pio\libdeps\LPC1768\U8glib-HAL_ID1932\src\clib\U8g_com_i2c.c:44:16: warning: ‘u8g_i2c_opt’ defined but not used [-Wunused-variable] static uint8_t u8g_i2c_opt; /* U8G_I2C_OPT_NO_ACK, SAM: U8G_I2C_OPT_DEV_1 */) while compiling. However, I still get the error in Arduino and am unable to compile. I have posted this problem on the Arduino boards as well. I am a beginner and cannot determine from where this error has originated, or how to fix it as I am not a coder.
Thanks in advance for any help that you might give me.

re: Arduino IDE

This is your error on Arduino IDE - probably because you don’t have the version of the U8glib-HAL library they use installed? Is the Arduino Uno the correct board type for your use case? Note that you can only compiled Marlin using the Arduino IDE for AVR, Due, and Teensy++ 2.0 - PlatformIO is the only supported build environment for ARM Cortex-4 boards.

re: PlatformIO

You can safely ignore the

.pio\libdeps\LPC1768\U8glib-HAL_ID1932\src\clib\U8g_com_i2c.c:44:16: warning: ‘u8g_i2c_opt’ defined but not used [-Wunused-variable] static uint8_t u8g_i2c_opt; /* U8G_I2C_OPT_NO_ACK, SAM: U8G_I2C_OPT_DEV_1 */

warning if it doesn’t stop the code from working/compiling… as it is exactly that… an optimisation warning from the compiler that it things the variable has been defined (created) but not used (which may or may not be the case).

Hi, thanks so much for your timely response. This is for a Bigtreetech SKR V1.3 board that I am using to replace the original board from the Creality Ender 5 3D printer. I am totally a newb and have very little experience at the software side of this. I am using this video to install it;

If you go to 4 minutes and 45 seconds in, he explains the changes that need to be made in Marlin, although I do not understand why as it runs on ATOM ??? I just don’t know :frowning: I took 3 days off of work, and instead of enjoying them with the family while printing up cool stuff, I have spent 30 + hours in-front of my laptop just trying to get this board to compile correctly and I am so frustrated. Any help that you might give me would be so greatly appreciated.

Running (or do you mean compiling) does not equal working. If you’re using PlatformIO, setting the default environment used does a lot of stuff, ranging from selecting the right processor type, toolchain, and configuration values. Either way, this does not account for things like ‘which stepper motor driver are you using (i.e. the TMC2209 or TMC5160)’… hence changes may be needed regardless of if you use PlatformIO /w Atom or Arduino IDE so that Marlin is configured correctly for your specific setup.

As to why the code compiled at all… this is most likely because the configuration settings in platformio.ini specifies what libraries the code needs, and allows PlatformIO to automatically download them if they are missing.

Since you’re compiling for a LPC176x ARM Cortex-M3 board… regardless of if you have the libraries installed correctly, I don’t think it will compile with Arduino IDE as it’s not a supported MCU type/family.