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:
opened 07:00PM - 26 Dec 19 UTC
topic: code
type: imperfection
### Describe the problem
If a library is installed under a path that contains C… yrillic characters, Arduino CLI is unable to discover it.
Compilation of sketches with an `#include` directive for a header file of a valid library fails with a "`No such file or directory`" error.
### To reproduce
```text
$ arduino-cli version
arduino-cli.exe Version: git-snapshot Commit: 4b70e023 Date: 2023-01-31T03:19:27Z
$ export ARDUINO_DIRECTORIES_USER="/tmp/arduino-cli-directories/мікроконтролер"
$ arduino-cli lib install Arduino_JSON
[...]
$ mkdir /tmp/FooSketch
$ printf "#include <Arduino_JSON.h>\nvoid setup() {}\nvoid loop() {}" > /tmp/FooSketch/FooSketch.ino
$ arduino-cli compile --fqbn arduino:avr:uno /tmp/FooSketch/FooSketch.ino
C:\Users\per\AppData\Local\Temp\FooSketch\FooSketch.ino:1:10: fatal error: Arduino_JSON.h: No such file or directory
#include <Arduino_JSON.h>
^~~~~~~~~~~~~~~~
compilation terminated.
Used library Version Path
Arduino_JSON 0.2.0 C:\Users\per\AppData\Local\Temp\arduino-cli-directories\мікроконтролер\libraries\Arduino_JSON
Used platform Version Path
arduino:avr 1.8.6 C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Error during build: exit status 1
```
### Expected behavior
Any path supported by the file system is also supported by the library discovery system
### Arduino CLI version
#### Original report
Arduino IDE 1.8.10
#### Last verified with
a527c7cdea0694da3034ba9995b7c9eaecfe074b
### Operating system
Windows
### Operating system version
- 10
- 11
### Additional context
The issue is not specific to Cyrillic. For example, it also occurs with a folder named `文` or `Κώστας`.
---
The fault only occurs on Windows. I am not able to reproduce it on Ubuntu 22.04 or macOS Ventura machines.
---
After changing system's locale from English to Bulgarian (win1251) + restart, the compilation succeeded. Unfortunately this is not viable solution, because we have many computers (>150) and changing system locale requires admin privileges.
My suggestion is that the IDE is not using the unicode version of the API when searching for libraries?
---
This is more likely to occur for those using [Microsoft **Onedrive**](https://en.wikipedia.org/wiki/OneDrive) because the default location of the sketchbook is:
```text
C:\Users\<username>\OneDrive\<localized "Documents">\Arduino
```
The `<localized "Documents">` in the path above is a placeholder the word "Documents" localized for the user's locale (e.g., `文档` or `Документы`)
#### Additional reports
- https://forum.arduino.cc/t/wemos-d1-mini-upload-problem/1084371
- https://forum.arduino.cc/t/no-such-file-or-directory-but-i-already-had-this-file/961118
- https://forum.arduino.cc/t/fatal-error-adafruit-neopixel-h-no-such-file-or-directory-but-i-have-it/1070069/15
- https://forum.arduino.cc/t/library-gives-error/1089633
- https://forum.arduino.cc/t/except-for-the-available-libraries-i-cant-use-other-libraries-even-though-i-have-downloaded-them/1092556
- https://forum.arduino.cc/t/compilation-error-due-to-library-hpp-file-not-being-detected/1127096
- https://forum.arduino.cc/t/which-arduino-nano-clone-i-have/1192347/11
- https://forum.arduino.cc/t/cannot-verify-the-arduino-code-because-the-installed-library-cannot-be-found/1215989
- https://forum.arduino.cc/t/10-fatal-error-onewire-h-no-such-file-or-directory/1223739
- https://forum.arduino.cc/t/unknown-error-for-arduino-1-8-19/1234260
- https://forum.arduino.cc/t/compilation-of-keypad-library-example-fails-key-h-no-such-file-or-directory/1241109
- https://forum.arduino.cc/t/mg135-library-please-answer/1254438
- https://forum.arduino.cc/t/i-keep-getting-library-compilation-error-despite-having-the-library/1255423
- https://forum.arduino.cc/t/no-such-file-or-directory/1255862/1
- https://forum.arduino.cc/t/no-such-file-or-directory/1255862/18
- https://forum.arduino.cc/t/arduino-ide-2-3-2-do-not-read-any-installed-library/1256849
- https://forum.arduino.cc/t/have-library-error-eventhough-installed/1258722
- https://forum.arduino.cc/t/arduino-ide-cannot-find-time-library-even-though-it-exists/1261462
- https://forum.arduino.cc/t/adafruit-bmp280-h-no-such-file-or-directory/1265651
- https://forum.arduino.cc/t/compilation-error-adafruit-mpu6050-h-no-such-file-or-directory/1279099
- https://forum.arduino.cc/t/pcm-h-no-such-file-or-directory/1282193
- https://forum.arduino.cc/t/no-such-file-directory-even-though-i-have-already-installed-the-related-library/1300806/1
- https://forum.arduino.cc/t/no-such-file-directory-even-though-i-have-already-installed-the-related-library/1300806/8
- https://forum.arduino.cc/t/no-such-library-error-please-help/1302038
- https://forum.arduino.cc/t/fatal-error-no-such-file-or-directory/1304273
- https://forum.arduino.cc/t/compilation-error-for-missing-header-file-even-though-i-have-the-library-installed/1312514
- https://forum.arduino.cc/t/liquidcrystal-i2c-compile-error/1313541
- https://forum.arduino.cc/t/arduino-ide-unable-to-recognize-installed-libraries-liquidcrystal-i2c-h-not-found/1318022
- https://forum.arduino.cc/t/arduino-ide-cannot-find-the-header-file-of-the-librarys/1321753
- https://forum.arduino.cc/t/dht22-library-including-error/1327026
- https://forum.arduino.cc/t/cant-find-libraries-while-using-example-code-in-said-library/1328557
- https://forum.arduino.cc/t/arduino-liquidcrystal-error/1335706
- https://forum.arduino.cc/t/library-not-found-error/1337263
- https://forum.arduino.cc/t/arduino-ide-libraries-not-working/1338401
- https://forum.arduino.cc/t/downloading-index-library-index-tar-bz2-problem/1327204/22
<a name="workaround"></a>
#### Workaround
##### Arduino CLI
1. Configure Arduino CLI to use a `directories.user` location that does not contain any non-ASCII characters in its path:
https://arduino.github.io/arduino-cli/latest/configuration/
1. Move the contents of the folder at the previous `directories.user` location to the new location.
##### Arduino IDE
1. Select **File > Preferences...** (or **Arduino IDE > Settings...** for macOS users) from the Arduino IDE menus.
The "**Preferences**" dialog will open.
1. Set the path in the "**Sketchbook location**" preference to a location that does not contain any non-ASCII characters in its path.
1. Click the "**OK**" button.
The "**Preferences**" dialog will close.
1. Move the contents of the folder at the previous path of the "**Sketchbook location**" preference to the new location.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-cli/issues?q=)
- [X] I verified the problem still occurs when using the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
- [X] My report contains all necessary details
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:
Select File > Preferences... from the Arduino IDE menus.
A "Preferences " dialog will open.
Click the Browse button to the right of the "Sketchbook location " field of the "Preferences " dialog.
A "Select new sketchbook location " dialog will open.
Select any folder that is not under a path containing problematic characters.
ⓘ You can create a new folder to use if you like.
Click the Choose button in the "Select new sketchbook location " dialog.
Click the OK button in the "Preferences " dialog.
Select File > Quit from the Arduino IDE menus.
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.