U8glib.h

I’ve been looking for a solution to this without success. I was changing the extruder feed rate in the configuration.h tab. Tried to upload the new firmware to my 3d printer, and Im hit with an error message:

In file included from sketch\MarlinConfig.h:30:0,

from C:\Users\jgsav\Downloads\Marlin-1.1.x\Marlin\Marlin.ino:31:

sketch\Configuration.h:1:20: fatal error: U8glib.h: No such file or directory

#include <U8glib.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

I have tried re-adding the U8glib.h files into the library, re downloading the U8glib.h zip files. Working on this a few days ago I was able to adjust the firmware no problem. I haven’t made any changes that should have effected it in this way. I believe I am using Arduino 1.8.5.

Do this:

  • Sketch > Include Library > Manage libraries
  • Wait for download to finish
  • In the "Filter your search" box, type "u8glib".
  • Scroll down until you see "U8glib by oliver". Click on it.
  • Click "Install"
  • Wait for installation to finish
  • Click "Close"

Just tried doing what you said, and still the exact same error message. Is there anything that could have effected it in this way that maybe I wasn't aware of? Is there anymore information I could give you to help narrow down the issue? Thank you in advance for your help

Do you see U8glib listed under the Sketch > Include Library menu (you might need to scroll the menu down to the bottom to see it)?

Please verify which version of the Arduino IDE you're using. You'll see it listed on the title bar of the Arduino IDE window.

I see U8glib listed in sketch>include library. When I clicked on it, it was added to the code as #include <U8glib.h>, which is what it’s supposed to do from my understanding. I am using Arduino 1.8.5 (Windows Store 1.8.10.0). Don’t know if it matters, but the U8glib file I installed from the library manager is version 1.19.1

What happens if you compile this code:

#include <U8glib.h>
void setup() {}
void loop() {}

C:\Users\jgsav\AppData\Local\Temp\arduino_modified_sketch_968402\sketch_apr12b.ino:1:20: fatal error: U8glib.h: No such file or directory

#include <U8glib.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Please do this:

  • File > Examples > U8glib > A2Printer
  • Sketch > Show Sketch Folder
  • Navigate up two folder levels.
  • Open the src subfolder.

Do you see a file named U8glib.h in that folder?

yes along with U8glib.cpp and a clib folder

Very strange. What is the full folder path of the U8glib library installation folder? I’m wondering if there is something specific to the location where it’s installed causing this problem.

C:\Users\jgsav\OneDrive\Documents\Arduino\libraries\U8glib\src

Aha! I suspect the problem is that pesky OneDrive.

Do this:

  • File > Preferences > Sketchbook location > set the sketchbook to any convenient folder that is not in the OneDrive
  • Click "OK"
  • Sketch > Include Library > Manage Libraries
  • Wait for download to finish
  • In the "Filter your search" box, type "u8glib".
  • Scroll down until you see "U8glib by oliver". Click on it.
  • Click "Install"
  • Wait for installation to finish
  • Click "Close"
  • Try compiling your Marlin again

The reason you needed to install U8glib again is because it was previously installed to your old sketchbook location and the Arduino IDE does not transfer the contents of your old sketchbook folder when you change to a different one. Everything is still there in your old sketchbook folder (C:\Users\jgsav\OneDrive\Documents\Arduino) so don't worry in case you have anything important in there you can just copy it over to the new sketchbook but I thought it would be best to just reinstall the library to make sure no problems are introduced.

Changed the file directory to C:\Users\jgsav\Documents

libraries\U8glib_Arduino-master\U8glib.cpp.o (symbol from plugin): In function `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':

(.text+0x0): multiple definition of `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'

sketch\U8glib.cpp.o (symbol from plugin):(.text+0x0): first defined here

c:/program files/windowsapps/arduinollc.arduinoide_1.8.10.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions

libraries\U8glib_Arduino-master\U8glib.cpp.o (symbol from plugin): In function `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':

(.text+0x0): multiple definition of `U8GLIB::initHWSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char)'

sketch\U8glib.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\U8glib_Arduino-master\U8glib.cpp.o (symbol from plugin): In function `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':

(.text+0x0): multiple definition of `U8GLIB::initI2C(_u8g_dev_t*, unsigned char)'

sketch\U8glib.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\U8glib_Arduino-master\U8glib.cpp.o (symbol from plugin): In function `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':

(.text+0x0): multiple definition of `U8GLIB::init8Bit(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'

sketch\U8glib.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\U8glib_Arduino-master\U8glib.cpp.o (symbol from plugin): In function `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':

(.text+0x0): multiple definition of `U8GLIB::init8BitFixedPort(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'

sketch\U8glib.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\U8glib_Arduino-master\U8glib.cpp.o (symbol from plugin): In function `U8GLIB::initSPI(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':

(.text+0x0): multiple definition of `U8GLIB::initRW8Bit(_u8g_dev_t*, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'

sketch\U8glib.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1 Error compiling for board Arduino/Genuino Mega or Mega 2560.

Download Marlin again. This problem is caused by your attempt to fix the previous error by putting the library files in the Marlin folder.

Its working again. Thank you so much. You are awesome :)

Glad I was able to help. You should definitely avoid putting any files on the OneDrive that will be used with Arduino. Unfortunately it's going to be a while before Arduino can fix that bug due to the root of the problem being in the Go programming language they are using for one of the components.