Problem connecting LiquidCrystal, Scheduler and stepper libraries on MEGA

I believe im having issue with putting libraries together. I have 2 lines of code that works on there own but when I put them together i'm getting the error code that is attached.

Breakdown of code:
I have got one code that has an lcd screen with a rotary encoder that when moved it increases and decreases the counter int and Counter int (void1).
Also a code that moves a stepper motor clockwise and anti clockwise then does some basic switching (void2). Both of these work fine on there own but when I put them in the same library, using different void loops, this error message occurs.

I have done as much research into these errors as I can but still cant get it to work, any suggestions?

Also I have these weird characters come up on my lcd (image attached). I thought it may be a hardware issue but I have checked and double check but it still happens. any advice will be greatly appreciated!

]

#include <LiquidCrystal.h>
#include <Scheduler.h>
#include <Stepper.h>

#define outputA 34      //DT pin 
#define outputB 36     //CLK pin

int buttonState = 0;  
const int stepsPerRevolution = 2038;  // change this to fit the number of steps per revolution or your motor
const int buttonPin = 9;
const int cameraPin = 8;
const int ledPin = 7;
const int relayPin = 6;
int counter = 0; 
int Counter = 60;
int aState;
int aLastState; 
boolean bcw; 
const int rs = 22, en = 24, d4 = 26, d5 = 28, d6 = 30, d7 = 32;

Stepper myStepper(stepsPerRevolution, 13, 12, 11, 10); // initialize the stepper library on pins 8 through 11:
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  Serial.begin(9600);
  Scheduler.startLoop(loop1);
  Scheduler.startLoop(loop2);


  lcd.begin(16,2);
  Serial.println("Bearing.");
  lcd.setCursor(0,0);
  
   pinMode (outputA,INPUT);
   pinMode (outputB,INPUT);
   aLastState = digitalRead(outputA);    // Reads the initial state of the outputA
  Scheduler.startLoop(1);
  char rx_byte = 0;
  String rx_str = "";

  {
    myStepper.setSpeed(6);   // set the speed at 60 rpm:
   pinMode(buttonPin, INPUT);
   pinMode(cameraPin, OUTPUT);
   pinMode(relayPin, OUTPUT);
   pinMode(ledPin, OUTPUT);
  }
}


 void loop1 () {
  { 
   aState = digitalRead(outputA);       // Reads the "current" state of the outputA
                                        // If the previous and the current state of the outputA are different, means knob is rotating
   if (aState != aLastState)
      {                                // If the outputB state is different to the outputA state, that means the encoder is rotating clockwise
        if (digitalRead(outputB) != aState) 
          { 
             counter ++;
             Counter ++;
             bcw = true;
          } 
        else 
          {
            bcw = false;
            counter --;
            Counter --;
          }
      lcd.setCursor(0,0);
      lcd.println("True N");
      lcd.setCursor(12,0);
      lcd.println(Counter);
      
      lcd.setCursor(0,2);
      lcd.println("Relative N");
      lcd.setCursor(12,2);
      lcd.println(counter);
      
    } 
aLastState = aState;              // Updates the previous state of the outputA with the current state
 }
 }

 void loop2 () {
   buttonState = digitalRead(buttonPin);
   digitalWrite(ledPin, HIGH);

  if (buttonState == HIGH) {
    digitalWrite(ledPin, LOW);
    digitalWrite(cameraPin, HIGH);
    delay (1000);
  Serial.println("clockwise");   // step one revolution  in one direction:
  myStepper.step(stepsPerRevolution);
  digitalWrite(cameraPin, LOW);
  delay(1000);
  digitalWrite(relayPin, HIGH);
  Serial.println("clockwise");   // step one revolution  in one direction:
  myStepper.step(-stepsPerRevolution);
  delay(5000);
  digitalWrite(relayPin, LOW);
  delay(5000);
} 
else {
}
}
/var/folders/l3/_wznvsn559qc05g29b8m1t3r0000gn/T//ccteLxkK.s: Assembler messages:
/var/folders/l3/_wznvsn559qc05g29b8m1t3r0000gn/T//ccteLxkK.s:1946: Error: constant value required
lto-wrapper: fatal error: /private/var/folders/l3/_wznvsn559qc05g29b8m1t3r0000gn/T/AppTranslocation/263289C8-3DA5-4DC9-8047-ACF4D0EDD5F7/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc returned 1 exit status
compilation terminated.
Multiple libraries were found for "LiquidCrystal.h"
 Used: /private/var/folders/l3/_wznvsn559qc05g29b8m1t3r0000gn/T/AppTranslocation/263289C8-3DA5-4DC9-8047-ACF4D0EDD5F7/d/Arduino.app/Contents/Java/libraries/LiquidCrystal
Multiple libraries were found for "Scheduler.h"
 Used: /Users/Mattstamp/Documents/Arduino/libraries/Scheduler
Multiple libraries were found for "Stepper.h"
 Used: /private/var/folders/l3/_wznvsn559qc05g29b8m1t3r0000gn/T/AppTranslocation/263289C8-3DA5-4DC9-8047-ACF4D0EDD5F7/d/Arduino.app/Contents/Java/libraries/Stepper
/private/var/folders/l3/_wznvsn559qc05g29b8m1t3r0000gn/T/AppTranslocation/263289C8-3DA5-4DC9-8047-ACF4D0EDD5F7/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Mega ADK.

Screenshot 2019-10-22 at 10.38.46.png

Post the code for the two programs that work on their own.

Are you getting compiler warnings with them?

...R

Thanks for the reply. Here are the 2 codes. Not that im aware of.

#include <LiquidCrystal.h>
#include <Scheduler.h>

#define outputA 7     //DT pin 
#define outputB 6     //CLK pin

int counter = 0; 
int Counter = 60;
int aState;
int aLastState; 
boolean bcw; 
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  Serial.begin(9600);
  lcd.begin(16,2);
  Serial.println("Bearing.");
  lcd.setCursor(0,0);
  
   pinMode (outputA,INPUT);
   pinMode (outputB,INPUT);
   aLastState = digitalRead(outputA);    // Reads the initial state of the outputA
  Scheduler.startLoop(1);
  char rx_byte = 0;
  String rx_str = "";
   } 

 void loop() {
  { 
   aState = digitalRead(outputA);       // Reads the "current" state of the outputA
                                        // If the previous and the current state of the outputA are different, means knob is rotating
   if (aState != aLastState)
      {                                // If the outputB state is different to the outputA state, that means the encoder is rotating clockwise
        if (digitalRead(outputB) != aState) 
          { 
             counter ++;
             Counter ++;
             bcw = true;
          } 
        else 
          {
            bcw = false;
            counter --;
            Counter --;
          }
      lcd.setCursor(0,0);
      lcd.println("North");
      lcd.setCursor(11,0);
      lcd.println(counter);
      
      lcd.setCursor(0,2);
      lcd.println("True North");
      lcd.setCursor(11,2);
      lcd.println(Counter);
      
    } 
aLastState = aState;              // Updates the previous state of the outputA with the current state
 }
 }
/*
 Stepper Motor Control - one revolution
 */

#include <Stepper.h>
int buttonState = 0;  
const int stepsPerRevolution = 2038;  // change this to fit the number of steps per revolution or your motor
const int buttonPin = 7;
const int cameraPin = 6;
const int relayPin = 5;
const int ledPin = 4;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); // initialize the stepper library on pins 8 through 11:


void setup() {
  myStepper.setSpeed(6);   // set the speed at 60 rpm:
   pinMode(buttonPin, INPUT);
   pinMode(cameraPin, OUTPUT);
   pinMode(relayPin, OUTPUT);
   pinMode(ledPin, OUTPUT);
  Serial.begin(9600);   // initialize the serial port:
}

void loop() {
   buttonState = digitalRead(buttonPin);
   digitalWrite(ledPin, HIGH);

  if (buttonState == HIGH) {
    digitalWrite(ledPin, LOW);
    digitalWrite(cameraPin, HIGH);
    delay (1000);
  Serial.println("clockwise");   // step one revolution  in one direction:
  myStepper.step(stepsPerRevolution);
  digitalWrite(cameraPin, LOW);
  delay(1000);
  digitalWrite(relayPin, HIGH);
  Serial.println("clockwise");   // step one revolution  in one direction:
  myStepper.step(-stepsPerRevolution);
  delay(5000);
  digitalWrite(relayPin, LOW);
  delay(5000);
} 
else {
}
}

Problem connecting LiquidCrystal, Scheduler and stepper libraries on MEGA

The Scheduler library enables the Arduino Due, Zero, and MKR1000 to run multiple functions at the same time. This allows tasks to happen without interrupting each other.

For more information about this library please visit us at http://www.arduino.cc/en/Reference/Scheduler

Does this library run on a Mega?

I tried putting it on my uno and still came up with the same error.

Scampy001:
I tried putting it on my uno and still came up with the same error.

I don't see Uno on that list either.

Ah I miss read it. Using the Due now works! thank you ever so much! Didn't realise some libraries are not compatible with different boards.

Scampy001:
Didn't realise some libraries are not compatible with different boards.

All the compatible boards mentioned are ARM-based while the Uno and Mega are AVR-based. So, I imagine it has something to do with that.