Compiler library error

(thanks to jremington for helping me make the post better)
PreInfo:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Uno R3"

After writing code for the Arduino and trying to verify said code, I ran into the error message:

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Define the rotary encoder pins
#define enc1PinA 3
#define enc1PinB 4
#define enc2PinA 5
#define enc2PinB 6
#define enc3PinA 7
#define enc3PinB 8

// Define the LCD properties
#define LCD_COLS 20
#define LCD_ROWS 4
#define LCD_ADDR 0x27

// Create the LCD object
LiquidCrystal_I2C lcd(LCD_ADDR, LCD_COLS, LCD_ROWS);

// Define the variables to store the encoder values
int enc1Val = 0;
int enc2Val = 0;
int enc3Val = 0;

// Define the interrupt service routines for the rotary encoders
void enc1ISR() {
  if (digitalRead(enc1PinB) == HIGH) {
    enc1Val++;
  } else {
    enc1Val--;
  }
}
void enc2ISR() {
  if (digitalRead(enc2PinB) == HIGH) {
    enc2Val++;
  } else {
    enc2Val--;
  }
}
void enc3ISR() {
  if (digitalRead(enc3PinB) == HIGH) {
    enc3Val++;
  } else {
    enc3Val--;
  }
}

void setup() {
  // Set the encoder pins as inputs
  pinMode(enc1PinA, INPUT);
  pinMode(enc1PinB, INPUT);
  pinMode(enc2PinA, INPUT);
  pinMode(enc2PinB, INPUT);
  pinMode(enc3PinA, INPUT);
  pinMode(enc3PinB, INPUT);

  // Enable the internal pull-up resistors for the encoder pins
  digitalWrite(enc1PinA, HIGH);
  digitalWrite(enc1PinB, HIGH);
  digitalWrite(enc2PinA, HIGH);
  digitalWrite(enc2PinB, HIGH);
  digitalWrite(enc3PinA, HIGH);
  digitalWrite(enc3PinB, HIGH);

  // Attach the interrupt service routines to the encoder pins
  attachInterrupt(digitalPinToInterrupt(enc1PinA), enc1ISR, CHANGE);
  attachInterrupt(digitalPinToInterrupt(enc2PinA), enc2ISR, CHANGE);
  attachInterrupt(digitalPinToInterrupt(enc3PinA), enc3ISR, CHANGE);

  // Initialize the LCD
  lcd.init();
  lcd.backlight();
}

void loop() {
  // Read the encoder values
  int enc1Mapped = map(enc1Val, -100, 100, 0, 255);
  int enc2Mapped = map(enc2Val, -100, 100, 0, 255);
  int enc3Mapped = map(enc3Val, -100, 100, 0, 255);

  // Display the encoder values on the LCD
  lcd.setCursor(0, 0);
  lcd.print("Encoder 1: ");
  lcd.print(enc1Mapped);
  lcd.setCursor(0, 1);
  lcd.print("Encoder 2: ");
  lcd.print(enc2Mapped);
  lcd.setCursor(0, 2);
  lcd.print("Encoder 3: ");
  lcd.print(enc3Mapped);

  // Delay for a short period to reduce screen flicker
  delay(50);
}

Error:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Uno"
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\100964\Documents\ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\100964\Documents\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\100964\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0000_0000 -ide-version=10819 -build-path C:\Users\100964\AppData\Local\Temp\arduino_build_780319 -warnings=none -build-cache C:\Users\100964\AppData\Local\Temp\arduino_cache_60639 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\100964\Documents\Arduino\sketch_apr16b\sketch_apr16b.ino

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\arduino-builder -compile -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\100964\Documents\ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\100964\Documents\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\100964\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0000_0000 -ide-version=10819 -build-path C:\Users\100964\AppData\Local\Temp\arduino_build_780319 -warnings=none -build-cache C:\Users\100964\AppData\Local\Temp\arduino_cache_60639 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\100964\Documents\ArduinoData\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\100964\Documents\Arduino\sketch_apr16b\sketch_apr16b.ino

Using board 'uno' from platform in folder: C:\Users\100964\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.6

Using core 'arduino' from platform in folder: C:\Users\100964\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...

recipe.preproc.macros pattern is missing

Error compiling for board Arduino Uno.

And nothing more.

Does anyone know how to fix this?

For informed help, please read and follow the instructions in the "How to get the best out of the forum" post, linked at the head of every forum category.

Most importantly, post the code, using code tags, along with the complete error message (copy and paste).

1 Like

Thanks for telling me, I've updated my original post.

I suggest to reinstall the Arduino IDE, as it seems to be missing a critical section required by the preprocessor.

Download it directly from Arduino, rather than Windows Store.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.