Skip to content Skip to sidebar Skip to footer

Fatal Error String.h: No such file or directory Arduino Linux

Arduino Error String.h No such file or directory

How to fix Fatal Error String.h: No such file or directory Arduino Linux - Several times I migrated Arduino projects from Windows to Linux, I got this "Fatal Error String.h: No such file or directory" .

Errors, especially when using Arduino for the first time after finishing Installing Linux OS. Before fixing it, it's good to know, what exactly is the String.h library?

Quoted from the official Arduino page, the String library is used to be able to manipulate text in more complicated ways than character arrays.

Manipulating this example adds, subtracts, concatenates, replaces substrings and searches for specific text. But memory usage is bigger than char array, but String library function side is easier than char array.

How to Fix Fatal String.h: No such file or directory
Fatal Error String.h

Examples of using the String library are:
Using a Fixed String:
String text = "Hi, introduce me is String";
Convert a character to a String:
Text string = String('a');
Convert a fixed string into a string object:
Second text String = String("Hi, introduce me is String");
Concatenate two Strings:
String text = String(Second text + "and others");
Convert an integer to decimal:
Text string = String(13);
Convert an integer value to DEC or a decimal to a String:
String text = String(analogRead(0), DEC);

Convert an integer value to HEX or Hexadecimal to String:
Text string = String(45, HEX);

Convert an integer value to BIN or Binary to a String:
Text string = String(255, BIN);

Convert a long variable value to a Decimal value to a String:
Text string = String(millis(), DEC);

How to fix Fatal Error String.h: No such file

To solve it is quite easy, in windows the format for writing the string.h library is String.h, while on linux, the writing is string.h.

In general, a String can be interpreted as a Text. Fixed this issue by replacing String.h > string.h


Yes, that's all, simple isn't it?

How to change it, open the library file with the .h extension which the Arduino IDE shows an error. For example, the error that appears is:

"/home/neon/Arduino/libraries/Prayer_Time_Edited/PrayerTimes.h:8:10: fatal error: String.h: No such file or directory"

The error that appears is in the PrayerTimes.h library. Open the library using a text editor, either notepad, notepad++, or something else as desired, then find the line "#include <String.h>" change it to "#include <string.h>", and save it.

Finished. Hope it is useful.

Post a Comment for "Fatal Error String.h: No such file or directory Arduino Linux"