Library gives error

I installed a new library in arduino and used its example code and now it shows this error when I compile

ERROR :

C:\Users\kelvi\AppData\Local\Temp\.arduinoIDE-unsaved2023113-26736-ny6log.da9gp\Read_1x_load_cell\Read_1x_load_cell.ino:21:10: fatal error: HX711_ADC.h: No such file or directory
 #include <HX711_ADC.h>
          ^~~~~~~~~~~~~
compilation terminated.
Alternatives for HX711_ADC.h: [HX711_ADC@1.2.12]
ResolveLibrary(HX711_ADC.h)
  -> candidates: [HX711_ADC@1.2.12]

Using library HX711_ADC at version 1.2.12 in folder: C:\Users\kelvi\OneDrive\文档\Arduino\libraries\HX711_ADC-master 
exit status 1

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

The error message seems quite clear. The sketch cannot find the file named HX711_ADC.h

Which library did you install and how did you install it ? Which Arduino board are you using ?

I have seen many previous problems reported in the forum when Arduino files are located on OneDrive so that could be a factor here

Please post the full sketch that you are compiling and use code tags when you post it

Hi @harish0522. The error is caused by the 文档 folder name in this path:

This is a known bug in the "Arduino CLI" tool Arduino IDE uses to compile your sketch:

Arduino IDE is storing your libraries in this C:\Users\kelvi\OneDrive\文档\Arduino\ because it is the default "sketchbook location" set in your Arduino IDE preferences.

The sketchbook folder serves two purposes:

  • A convenient location to store your sketches
  • The location the Arduino IDE's Library Manager and Add .ZIP Library... features installs libraries to.

So one workaround for this bug is to set that preference to a different location that doesn't contain any problematic characters.

I'll provide instructions:

  1. Select File > Preferences... from the Arduino IDE menus.
    A "Preferences" dialog will open.
  2. Click the Browse button to the right of the "Sketchbook location" field of the "Preferences" dialog.
    A "Select new sketchbook location" dialog will open.
  3. Select any folder that is not under a path containing problematic characters.
    You can create a new folder to use if you like.
  4. Click the Choose button in the "Select new sketchbook location" dialog.
  5. Click the OK button in the "Preferences" dialog.
  6. Select File > Quit from the Arduino IDE menus.
  7. Copy all the files and folders from your previous sketchbook folder:
    C:\Users\kelvi\OneDrive\文档\Arduino\
    
    To the new folder you selected at step (3).

Please let me know if you have any questions or problems while following those instructions.