Have library error eventhough installed

C:\Users\USER\OneDrive\Desktop\FYP2\codings\2nd_try\2nd_try.ino:1:10: fatal error: Adafruit_LiquidCrystal.h: No such file or directory
#include "Adafruit_LiquidCrystal.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: Adafruit_LiquidCrystal.h: No such file or directory

I've installed the Adafruit_LiquidCrystal library and checked on the Sketch>Include library that the library is available. However, when I verify it this error occured.

I've shared this code to my friend and verified using her arduino ide and this error not occured at all

Welcome to the forum

Where exactly on your PC is the Adafruit_LiquidCrystal.h file located ?

Have you, perchance, obfuscated your actual user name in the path with the text 'USER'?

And does your actual user name in the path include non-ASCII characters?

If the answers to both those question are 'yes', then you've likely run into this problem:

inside library file in arduino folder

Please post the actual path to where it is located rather than describing it in general terms

"C:\Users\USER\OneDrive\文档\Arduino\libraries\Adafruit_LiquidCrystal"

Hi @farahm_43. As was mentioned earlier in this thread by @van_der_decken, unfortunately there is a bug in the sketch compiler that causes it to fail to find the library when it is installed under a path that contains this sort of character.

The workaround will be to configure Arduino IDE to use a different path to store libraries. I'll provide instructions you can follow to do that:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Click the "BROWSE" button on the right side of the "Sketchbook location" field.
    The "Select a new sketchbook location" dialog will open.
  3. Select a folder in any location that contains only basic ASCII characters (the characters A-z, 0-9, _, -, . are safe).
    :warning: Make sure to pick a location that will be safe to store your files since, in addition to containing installed libraries, the sketchbook is a convenient location to save your sketches.
  4. Click the "Choose" button in the "Select a new sketchbook location" dialog.
  5. Click the "OK" button in the "Preferences" dialog.
  6. Move all the files from the folder at the path of the old sketchbook location:
    c:\Users\USER\OneDrive\文档\Arduino
    
    to the folder at the path of the new sketchbook location you set in the Arduino IDE preferences.

Once you have finished performing the instructions above, try compiling your sketch again. Hopefully the compilation will be successful this time.

Thank you so much for helping me one by one! I really appreciate it

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.