How can a library.properties-file cause an error no such file or directory?

Hi Everybody,

in the meantime I narrowed down the problem to be the library.properties-file.

If I delete the file library.properties from the library-folder it compiles successfully.

For historical reasons I keep the postings below.

The original titel of this thread was:

Compiler-messages: what could cause not finding any candidate

If you want to follow the actual state you can jump down to post #11

just now I tried the new KeyboardUTF8-library from @johnwasser
I'm pretty sure that I installed the ZIP-library correct.
But I get the error-message

KeyboardUTF8.h: No such file or directory

This is the full compiler-report

F:\MyPortable-PRgs\arduino1.8.13\arduino-builder -dump-prefs -logger=machine -hardware F:\MyPortable-PRgs\arduino1.8.13\hardware -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\packages -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\hardware -tools F:\MyPortable-PRgs\arduino1.8.13\tools-builder -tools F:\MyPortable-PRgs\arduino1.8.13\hardware\tools\avr -tools F:\MyPortable-PRgs\arduino1.8.13\portable\packages -built-in-libraries F:\MyPortable-PRgs\arduino1.8.13\libraries -libraries F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\libraries -fqbn=Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off -vid-pid=2886_802F -ide-version=10813 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_779855 -warnings=none -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_108076 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.bossac.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0-arduino3.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.CMSIS.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.CMSIS-5.4.0.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.arduinoOTA.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.CMSIS-Atmel.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -prefs=runtime.tools.CMSIS-Atmel-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -prefs=runtime.tools.openocd.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -verbose F:\MyPortable-PRgs\arduino-1.8.16\portable\sketchbook\USB-Keyboard-Emulator-Demo-001\USB-Keyboard-Emulator-Demo-001.ino
F:\MyPortable-PRgs\arduino1.8.13\arduino-builder -compile -logger=machine -hardware F:\MyPortable-PRgs\arduino1.8.13\hardware -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\packages -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\hardware -tools F:\MyPortable-PRgs\arduino1.8.13\tools-builder -tools F:\MyPortable-PRgs\arduino1.8.13\hardware\tools\avr -tools F:\MyPortable-PRgs\arduino1.8.13\portable\packages -built-in-libraries F:\MyPortable-PRgs\arduino1.8.13\libraries -libraries F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\libraries -fqbn=Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off -vid-pid=2886_802F -ide-version=10813 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_779855 -warnings=none -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_108076 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.bossac.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0-arduino3.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.CMSIS.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.CMSIS-5.4.0.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.arduinoOTA.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.CMSIS-Atmel.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -prefs=runtime.tools.CMSIS-Atmel-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -prefs=runtime.tools.openocd.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -verbose F:\MyPortable-PRgs\arduino-1.8.16\portable\sketchbook\USB-Keyboard-Emulator-Demo-001\USB-Keyboard-Emulator-Demo-001.ino
Using board 'seeed_XIAO_m0' from platform in folder: F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\hardware\samd\1.8.1
Using core 'arduino' from platform in folder: F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\hardware\samd\1.8.1
Detecting libraries used...
"F:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"USB-Keyboard-Emulator-Demo-001.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\variants\\XIAO_m0" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_779855\\sketch\\USB-Keyboard-Emulator-Demo-001.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for KeyboardUTF8.h: []
ResolveLibrary(KeyboardUTF8.h):1:10: fatal error: KeyboardUTF8.h: No such file or directory

  -> candidates: []
 #include <KeyboardUTF8.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
KeyboardUTF8.h: No such file or directory

What I found is that in this case the message

"F:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"USB-Keyboard-Emulator-Demo-001.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\variants\\XIAO_m0" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_779855\\sketch\\USB-Keyboard-Emulator-Demo-001.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for KeyboardUTF8.h: []
ResolveLibrary(KeyboardUTF8.h):1:10: fatal error: KeyboardUTF8.h: No such file or directory

`  -> candidates: [] `

no candidate is found.

There is no filename inside the edgy brackets

My self-created library KeyboardGER2 is in the same filestructure and does compile for the Seeeduino-Board I'm using.

There the correct "candidate" is found

"F:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"Seeeduino-XIAO-011-SerInKeyB-GER-SndReturn.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\variants\\XIAO_m0" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\sketchbook\\libraries\\DebugTxtVar" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_377237\\sketch\\Seeeduino-XIAO-011-SerInKeyB-GER-SndReturn.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for KeyboardGER2.h: [KeyboardGER2]
ResolveLibrary(KeyboardGER2.h)
  -> candidates: [KeyboardGER2]

what causes not finding John Wassers KeyboardUTF8-library???

best regards Stefan

Please explain the steps you took to install it.

I used this method successfully for multiple GiPo-ZIP-libraries.

I downloaded the ZIP-file from GitHub.
On GitHub the filename is
grafik
I renamed this filename to
grafik

I opened the ZIP-file
renamed the folder inside the ZIP-file to match the Arduino-convention
foldername, *.h-name *.cpp-name and classname all four chall have the same
grafik

Then imported the ZIP-library
grafik

The Arduino-IDE successfully imported the library. At least shows a message
grafik

Checking it under include libraries show the matching entry

Checking with the explorer it shows the folder is there

And inside the folder it seems everything is there

Still the compiler complaints that he can't find the file

Now - what's wrong?
best regards Stefan

It means exactly what the error message says - it CANNOT find the include file "KeyboardUTF8.h". So, wherever it is expecting to find that file, it isn't there. You need to figure out why.

Check to make sure there is not an additional hidden file extension on the files.

I have windows configured to show ALL file-extensions.

or is there any kind of super-special option that can hide some extensions??

I say it is there!

Compare the ENTIRE path in the error message, which shows where the compiler is looking for the file, to the ENTIRE path to where the file actually is. They are NOT the same.

To analyse what the problem might be i did the following:

I created a new subdirectory in folder libraries named
"KeyboardJoWa" JoWa for honoring John Wassers work to create this library

Then I copied the complete content of file Keyboard_GR.h into the clipboard
pasted the content into a new file created by notepadd++ and saved the file with name Keyboard_GER.h into the libraries subfolder KeyboardJoWa

Then I copied the content of file KeyboardUTF8.h into the clipboard
pasted the content into a new file created by notepadd++ and save the file with name KeyboardJoWa.h into the libraries subfolder KeyboardJoWa

Then I renamed everything inside the file from KeyboardUTF8 to
KeyboardJoWa

Then I copied the content of file KeyboardUTF8.cpp into the clipboard
pasted the content into a new file created by notepadd++ and saved the file with name KeyboardJoWa.cpp into the libraries subfolder KeyboardJoWa

Then I renamed everything inside the file from KeyboardUTF8 to
KeyboardJoWa

finally I modified John Wassers demo-code from

#include <KeyboardUTF8.h>
#include <src/Keyboard_GR.h>

// Keyboard_GR Keyboard_german;

void setup()
{
  Keyboard_GR.println("This is a test.");
}

void loop() {}

to

#include <KeyboardJoWa.h>
#include <Keyboard_GER.h>

// Keyboard_GR Keyboard_german;

void setup()
{
  Keyboard_GER.println("This is a test.");
}

void loop() {}

So in summary I created by hand:

  • the subfolder
  • all the files and stored the files using notepad++

and this did compile successfully.

Just a thought:
Could the problem be with installing a ZIP-library with the Arduino-IDE?

Could it be that the problem is caused by the Anti-Virussoftware Kaspersky Total Security not allowing the compiler to have access to files installed through the function Add Zip-library?

best regards Stefan

I am somewhat weak on where Arduino looks for libraries, but when I download a library from Github, I do not rename it. I use the library manager and install the zip I downloaded.

If you turn on verbose during compile, the error log may tell you exactly where it is looking for the file.

Alternately, you could just put the .cpp and .h files into your project directory.

I narrowed down the problem to be caused by the library.properties-file

Step by step I copied the needed files into the library-folder as soon as I copied the
library.properties-file the error occurs. If I delete this file everything compiles.

Never have done anything with a library.properties-file

Does anybody see something strange what could cause this error?

name=KeyboardUTF8
version=1.0.0
author=JohnWasser
maintainer=JohnWasser <Arduino@John-Wasser.com>
sentence=Allows the Keyboard library to work with non-US keyboard layouts.
paragraph=This library layers over the Keyboard library.  It allows correct typing of strings on systems using non-US keyboards and also adds support for Unicode characters in UTF-8 format.
category=Device Control
url=https://github.com/JohnWasser/Arduino_KeyboardUTF8
architectures=*

best regards Stefan

What happens if you make the architecture specific instead of the *.

architectures = samd

with
architectures=samd

still the same error
with file library.properties error no such file or directory

without the file compiles

without file

So, delete library.properties and move on?

Leave the library.properties as it is.
Move the KeyboardUTF8.h and KeyboardUTF8.cpp files into the src directory of the library.

Apparently the assumption is being made that if there is a src folder, that the library files will be located there.

1 Like

There is some technical information on this subject in the Arduino Library Specification:
https://arduino.github.io/arduino-cli/dev/library-specification/#source-code

This diagram made the situation more clear in my mind:

image

So you can see that there are two requirements for a library to be treated as having a "recursive layout":

  • Presence of the library.properties metadata file ("1.5 format" library)
  • Presence of the src subfolder.

If both of those conditions exist then the source files are searched for under the src subfolder of the library. Take either of the two away, and the root of the library folder is instead searched.

1 Like

ahhh ! Yes now I understand. I guess Johns intention was to have all the language-specific headerfiles in a subfolder to present the library in a cleaned up order.
With a small loss of oversight to fullfill this library.properties specification the main library-files KeyboardUTF8.h / KeyboardUTF8.cpp should be in src-subfolder and inside this src-subfolder have another subfolder for example "languages" that hold the 206 language-specific headerfiles. I guess "recursive" should be able to crawl down into sub-sub-sub-folders.

@johnwasser : What do you think?

best regards Stefan

That is correct. All source files in all subfolders under src are compiled if the library is determined to be a dependency of the sketch. The discovery process is done only on the headers in the root of the src subfolder, but after that the library folder has been added to the include search path (-I), so you can then include headers in subfolder as well. For example, if the library was structured like so:

Arduino_KeyboardUTF8
|_ library.properties
|_ src
   |_ KeyboardUTF8.h
   |_ layouts
      |_ Keyboard_ADLM.h

then you can do this:

#include <KeyboardUTF8.h>  // This one causes a successful discovery and adds the library to the include search path
#include <layouts/Keyboard_ADLM.h>  // Now you can include files from the subfolders under `src` because it's already in the include search path

But not this:

#include <layouts/Keyboard_ADLM.h>  // Discovery can't find this header so you get an error
#include <KeyboardUTF8.h> 

I've modified the library to use this layout:

Arduino_KeyboardUTF8
|_ library.properties
|_ keywords.txt
|_ src
   |_ KeyboardUTF8.h
   |_ KeyboardUTF8.cpp
   |_ languages
      |_ Keyboard_ADLM.h
      |_ ...

That seems to be working except that the keywords.txt file only seems to work for the "KeyboardUTF8" keyword and not the 200+ language variants.

The separating character preceding KEYWORD1 must be a tab, not a space.

1 Like