B4R Question [SOLVED] <LiquidCrystal.h> not found - How to change libraries folder in arduino-cli

hatzisn

Expert
Licensed User
Longtime User
Good evening everyone,

I kept postponing this but now that I have to correct something and I cannot do it, we have reached the node...
What happens is that I had Arduino 1.8.19 installed in my computer and I had created an app that used Liquid Crystal Display. I completely removed the Arduino 1.8.19 and installed the 2.0. I keep getting this error in the logs of B4R.

cli: compile -b esp8266:esp8266:d1_mini C:\B4X\MyCode\B4R\MyCode\TestApps\LCDPLA~1\Objects\src\src.ino -v --board-options baud=921600,xtal=80,eesz=4M2M,dbg=Disabled,lvl=None____,ip=lm2f,vt=flash,exception=disabled,wipe=none,ssl=all
FQBN: esp8266:esp8266:d1_mini:exception=disabled
Using board 'd1_mini' from platform in folder: C:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1
Using core 'esp8266' from platform in folder: C:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1
Detecting libraries used...
C:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1/tools/sdk/include -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1/tools/sdk/lwip2/include -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1/tools/sdk/libc/xtensa-lx106-elf/include -IC:\Users\hatzi\AppData\Local\Temp\arduino\sketches\657414AA812E4C28897D6115C790BAC1/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -DNEW_OOM_ABORT -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_WEMOS_D1MINI" -DFLASHMODE_DIO -DESP8266 -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266 -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\variants\d1_mini C:\Users\hatzi\AppData\Local\Temp\arduino\sketches\657414AA812E4C28897D6115C790BAC1\sketch\src.ino.cpp -o nul
Alternatives for LiquidCrystal.h: [[email protected]]
ResolveLibrary(LiquidCrystal.h)
-> candidates: [[email protected]]
C:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1/tools/sdk/include -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1/tools/sdk/lwip2/include -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1/tools/sdk/libc/xtensa-lx106-elf/include -IC:\Users\hatzi\AppData\Local\Temp\arduino\sketches\657414AA812E4C28897D6115C790BAC1/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -DNEW_OOM_ABORT -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10607 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_WEMOS_D1MINI" -DFLASHMODE_DIO -DESP8266 -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266 -IC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\variants\d1_mini -IC:\Users\hatzi\OneDrive\Έγγραφα\Arduino\libraries\LiquidCrystal\src C:\Users\hatzi\AppData\Local\Temp\arduino\sketches\657414AA812E4C28897D6115C790BAC1\sketch\src.ino.cpp -o nul
Alternatives for LiquidCrystal.h: [[email protected]]
ResolveLibrary(LiquidCrystal.h)
-> candidates: [[email protected]]
In file included from C:\B4X\MyCode\B4R\MyCode\TestApps\LCDPlayground\Objects\src\src.ino:1:0:
C:\B4X\MyCode\B4R\MyCode\TestApps\LCDPlayground\Objects\src\B4RDefines.h:22:27: fatal error: LiquidCrystal.h: No such file or directory
#include <LiquidCrystal.h>
^
compilation terminated.
Error during build: exit status 1
[92mUsed library[0m [92mVersion[0m [90mPath[0m
[93mLiquidCrystal[0m 1.0.7 [90mC:\Users\hatzi\OneDrive\Έγγραφα\Arduino\libraries\LiquidCrystal[0m
[92mUsed platform[0m [92mVersion[0m [90mPath[0m
[93mesp8266:esp8266[0m 2.7.1 [90mC:\Users\hatzi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1[0m

Also in the compilation window I get this:

B4R Version: 4.00
Parsing code. (0.03s)
Building folders structure. (0.01s)
Compiling code. (0.03s)
Building project (0.03s)
Compiling (LOLIN(WEMOS) D1 R2 & mini) Error
In file included from C:\B4X\MyCode\B4R\MyCode\TestApps\LCDPlayground\Objects\src\src.ino:1:0:
C:\B4X\MyCode\B4R\MyCode\TestApps\LCDPlayground\Objects\src\B4RDefines.h:22:27: fatal error: LiquidCrystal.h: No such file or directory
#include <LiquidCrystal.h>
^
compilation terminated.
Error during build: exit status 1

I cannot figure out what is wrong. What I did is the following :

1) Uninstall Arduino IDE 2.x
2) Uninstall B4R
3) Clear the Registry from all Arduino keys
4) Reinstall Arduino IDE
5) Reinstall B4R
6) Because Documents folder is located in OneDrive I right clicked and selected "Make all files local" in Arduino folder. Meanwhile I see the full folder with a green check next to it (all files are local)

(And because of the fact that the Arduino IDE sketchbook location in Arduino IDE preferences, contains unicode characters - in Greek: Documents=Έγγραφα)
7) Changed Windows Language (nothing changed - Arduino sketchbook still displayed with ~έγγραφα~)
8) Changed Windows Locale (nothing changed - the same)

I tried directly in Arduino with this sketch and got the same error when I validated the code.

C++:
#include <LiquidCrystal.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

At last what I tried and it worked in Arduino but not in B4R was:
9) I copied the Arduino folder in Onedrive/Έγγραφα (=documents) in an other folder outside and have set the sketchbook folder to this new folder. In Arduino IDE the previous brief sketch compiled but in B4R again not.

I am completely through of ideas and I cannot figure out how to make it work. Any bells anyone?
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
I solved it!!!

Steps to solve it:
1) Go to arduino-cli folder and write in a cmd (might require administrator privileges) :

B4X:
arduino-cli config init

2) It will tell you where the configuration yaml is saved and its name.

3) Edit it with notepad in line "user:" in "directories:" and set a folder outside the unicode documents folder (έγγραφα in greek) for the sketchbook folder where it will contain the libraries . If no " directories: " is available then add the following:

YAML:
directories:
    user: C:\MyCustomFolder

You 're done.
 
Last edited:
Upvote 0
Top