error: conflicting declaration of C function

/*
This is a code for a color combo lock. 
*/
#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);


const int YellowPin=A0;
const int GreenPin=A1;
const int BluePin=A2;
const int RedPin=A3;
const int SolenoidPin=13;
const int DoorBellPin=A4;

String StringColorPressed=String("none");
int ColorPressed=0;

// is button pressed? booleans (yes or no)
bool ButtonPressed=false;
bool YellowPressed=false;
bool GreenPressed=false;
bool BluePressed=false;
bool RedPressed=false;
bool MultiButtonsPressed=false;

//for passcode correct color booleans
bool FirstColorCorrect;
bool FirstColorPressed;
bool SecondColorCorrect;
bool SecondColorPressed;
bool ThirdColorCorrect;
bool ThirdColorPressed;
bool FourthColorCorrect;
bool FourthColorPressed;
bool FifthColorCorrect;
bool FifthColorPressed;
bool SixthColorCorrect;
bool SixthColorPressed;

void wait(int TimeWaiting){
    int StartTime=millis();
    int FinishTime=StartTime+TimeWaiting;
    while (millis()<FinishTime){
    lcd.print("waiting");
    delay(200);
    lcd.clear();
    lcd.print("waiting.");
    delay(200);
    lcd.clear();
    lcd.print("waiting..");
    delay(200);
    lcd.clear();
    lcd.print("waiting...");
    delay(200);
    lcd.clear();
    }
  }
void Check_Color_Input(){
   if (YellowPressed){
      ColorPressed=1;
      StringColorPressed=String("Yellow");
    }
    if (GreenPressed){
      ColorPressed=2;
      StringColorPressed=String("Green");
    }
    if (BluePressed){
      ColorPressed=3;
      StringColorPressed=String("Blue");
    }
    if (RedPressed){
      ColorPressed=4;
      StringColorPressed=String("Red");
    }
}
void Check_Pressed(){
  if (analogRead(YellowPin)==1023){
    
    //debugging
    delay(10);
    if (analogRead(YellowPin)==1023){
      YellowPressed=true;
      StringColorPressed=String("Yellow");
    }
    else {(YellowPressed=false);}
    
  }
  else (YellowPressed=false);
  if (analogRead(GreenPin)==1023){
    
    //debugging
    delay(10);
    if (analogRead(GreenPin)==1023){
      GreenPressed=true;
      ColorPressed=2;
      StringColorPressed=String("Green");
    }
    else {(GreenPressed=false);}
    
  }
  else {
    GreenPressed=false;
  }
  if (analogRead(BluePin)==1023){
    
    //debugging
    delay(10);
    if (analogRead(BluePin)==1023){
      BluePressed=true;
      ColorPressed=3;
      StringColorPressed=String("Blue");
    }
    else {(BluePressed=false);}
    
  }
  else {
    BluePressed=false;
  }
  if (analogRead(RedPin)==1023){
    
    //debugging
    delay(10);
    if (analogRead(RedPin)==1023){
      RedPressed=true;
      ColorPressed=4;
      StringColorPressed=String("Red");
    }
    else {(RedPressed=false);}
    
  }
  else {
    RedPressed=false;
  }
  if (YellowPressed or GreenPressed or BluePressed or RedPressed){
    ButtonPressed=true;
  }
  else {
    ButtonPressed=false;
  }
  if (ButtonPressed and (RedPressed and BluePressed or YellowPressed and RedPressed
    or RedPressed and GreenPressed or GreenPressed and BluePressed
    or GreenPressed and YellowPressed or BluePressed and YellowPressed
    or RedPressed and GreenPressed and YellowPressed
    or YellowPressed and GreenPressed and BluePressed
    or YellowPressed and BluePressed and RedPressed
    or GreenPressed and BluePressed and RedPressed
    or YellowPressed and GreenPressed and BluePressed and RedPressed)){
      MultiButtonsPressed=true;
  }
  else {
    MultiButtonsPressed=false;
  }
}

void UnlockDoor(){
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Unlocking");
  lcd.setCursor(0,1);
  lcd.print("Door");
  digitalWrite(SolenoidPin, LOW);
  delay(100);
  digitalWrite(SolenoidPin, HIGH);
  delay(2000);
  lcd.clear();
}
void Intro(){
  lcd.setCursor(0, 0);
  lcd.print("Hello");
  delay(2000); 
  lcd.clear(); 
  lcd.print("Complete the");
  lcd.setCursor(0,1); 
  lcd.print("following steps"); 
  delay(500);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("following steps");
  lcd.setCursor(0,1);
  lcd.print("to enter");
  delay(3000);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Press the");
  lcd.setCursor(0,1);
  lcd.print("green button");
  Check_Pressed();
  delay(1000);
  Check_Pressed();
  while (ButtonPressed==false){
    lcd.clear();
    lcd.setCursor(0,0);
    wait(800);
    Check_Pressed();
  }
  if (ButtonPressed){
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Button pressed = ");
    lcd.setCursor(0,1);
    lcd.print(StringColorPressed);
    delay(5000);
    lcd.clear();
    lcd.setCursor(0,0);
    if (GreenPressed){
      lcd.print("Color selected");
      lcd.setCursor(0,1);
      lcd.print("is correct!");
      delay(3000);
    }
     else if (YellowPressed or BluePressed or RedPressed){
      lcd.print("Color selected");
      lcd.setCursor(0,1);
      lcd.print("is incorrect!");
      delay(1000);
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Lock for one");
      lcd.setCursor(0,1);
      lcd.print("minute.");
      lcd.clear();
      lcd.setCursor(0,0);
      wait(60000);
    }
    else if (MultiButtonsPressed){
      lcd.clear();
      lcd.print("ERROR");
    }
}
}
void PassCode(){
   Check_Pressed();
   lcd.clear();
   lcd.setCursor(0,0);
   lcd.print("Enter Passcode");
   while(ButtonPressed==false){
     delay(1);
     Check_Pressed();
   }
   if (ButtonPressed){
     if (GreenPressed){
       FirstColorCorrect=true; 
     }
     else {
       FirstColorCorrect=false;;
     }
     FirstColorPressed=true;
     lcd.clear();
     lcd.print("Color 1 Entered");
     delay(500);
     lcd.clear();
   }
   
    
    Check_Pressed();
   
    while(ButtonPressed==false){
     delay(1);
     Check_Pressed();
   }
   if (ButtonPressed){
     if (GreenPressed){
       SecondColorCorrect=true; 
     }
     else {
       SecondColorCorrect=false;;
     }
     SecondColorPressed=true;
     lcd.clear();
     lcd.print("Color 2 Entered");
     delay(500);
     lcd.clear();
   }
    
    
    Check_Pressed();
    
    while(ButtonPressed==false){
     delay(1);
     Check_Pressed();
   }
   if (ButtonPressed){
     if (RedPressed){
       ThirdColorCorrect=true; 
     }
     else {
       ThirdColorCorrect=false;;
     }
     ThirdColorPressed=true;
     lcd.clear();
     lcd.print("Color 3 Entered");
     delay(500);
     lcd.clear();
   }
   
    
    Check_Pressed();
   
   while(ButtonPressed==false){
     delay(1);
     Check_Pressed();
   }
   if (ButtonPressed){
     if (YellowPressed){
       FourthColorCorrect=true; 
     }
     else {
       FourthColorCorrect=false;;
     }
     FourthColorPressed=true;
     lcd.clear();
     lcd.print("Color 4 Entered");
     delay(500);
     lcd.clear();
   }
   
    
    Check_Pressed();
   
   while(ButtonPressed==false){
     delay(1);
     Check_Pressed();
   }
   if (ButtonPressed){
     if (YellowPressed){
       FifthColorCorrect=true; 
     }
     else {
       FifthColorCorrect=false;;
     }
     FifthColorPressed=true;
     lcd.clear();
     lcd.print("Color 5 Entered");
     delay(500);
     lcd.clear();
   }
   
   
    Check_Pressed();
   
   while(ButtonPressed==false){
     delay(1);
     Check_Pressed();
   }
   if (ButtonPressed){
     if (BluePressed){
       SixthColorCorrect=true; 
     }
     else {
       SixthColorCorrect=false;
       lcd.clear();
       lcd.print("Color 6 Entered");
       delay(500);
       lcd.clear();
     }
     SixthColorPressed=true;
   }
   
    if (FirstColorCorrect and SecondColorCorrect and ThirdColorCorrect and FourthColorCorrect
    and FifthColorCorrect and SixthColorCorrect){
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Passcode Correct");
      lcd.setCursor(0,1);
      lcd.print("Access Granted");
      UnlockDoor();
    }
    else {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Passcode Incorrect");
      lcd.setCursor(0,1);
      lcd.print("Access Denied");
      delay(1000);
      wait(60000);
    }
}
void setup() {
  pinMode(YellowPin,INPUT); //Yellow button
  pinMode(GreenPin, INPUT); //Green Button
  pinMode(BluePin, INPUT); //Blue Button
  pinMode(RedPin, INPUT); //Red Button
  pinMode(SolenoidPin, OUTPUT); 
  pinMode(DoorBellPin, INPUT);
  digitalWrite(SolenoidPin, HIGH);
  lcd.begin(16, 2); 
  lcd.print("Hello,");
}

void loop() {
    if(analogRead(DoorBellPin)==1023){
      delay(10);
      if(analogRead(DoorBellPin)==1023){
        Intro();
        PassCode();
      }
    }
  }

Error Message:

error: conflicting declaration of C function 'char* utoa(long unsigned int, char*, int)'
./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:sam:arduino_due_x_dbg -build-cache /tmp -build-path /tmp/863701745/build -verbose -libraries /tmp/863701745/custom -libraries /tmp/863701745/pinned /tmp/863701745/Color_Combo_Lock_

Using library liquidcrystal_1_0_7 at version 1.0.7 in folder: /home/ubuntu/opt/libraries/latest/liquidcrystal_1_0_7

In file included from /home/ubuntu/opt/cores/arduino/sam/cores/arduino/Arduino.h:35:0,

from /tmp/863701745/build/sketch/Color_Combo_Lock_.ino.cpp:1:

/home/ubuntu/opt/cores/arduino/sam/cores/arduino/itoa.h:34:14: error: conflicting declaration of C function 'char* utoa(long unsigned int, char*, int)'

extern char* utoa( unsigned long value, char *string, int radix ) ;

^~~~

In file included from /home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdlib.h:11:0,

from /home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/cstdlib:75,

from /home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/stdlib.h:36,

from /home/ubuntu/opt/cores/arduino/sam/cores/arduino/Arduino.h:24,

from /tmp/863701745/build/sketch/Color_Combo_Lock_.ino.cpp:1:

/home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdlib.h:225:8: note: previous declaration 'char* utoa(unsigned int, char*, int)'

char * _EXFUN(utoa,(unsigned, char *, int));

^

exit status 1

I was trying to make a color combo door lock and was testing it (as I had many times before) and I got this error (above).I don't know how this error was created. The only thing that I did in between verifying code was connect a power adapter. I was wondering if anyone could help me figure out what this is and how to fix it. And Sorry that this is in 2 different posts there was too many characters
Thanks.

Compiles OK in IDE 1.8.5, don’t have hardware to run. ?
Restart Arduino IDE and try again.

Detecting libraries used...
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/cores/arduino" "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs" "/tmp/arduino_build_643240/sketch/sketch_jul24a.ino.cpp" -o "/dev/null"
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/cores/arduino" "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs" "-I/home/jca/arduino-1.8.5/libraries/LiquidCrystal/src" "/tmp/arduino_build_643240/sketch/sketch_jul24a.ino.cpp" -o "/dev/null"
Using cached library dependencies for file: /home/jca/arduino-1.8.5/libraries/LiquidCrystal/src/LiquidCrystal.cpp
Generating function prototypes...
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/cores/arduino" "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs" "-I/home/jca/arduino-1.8.5/libraries/LiquidCrystal/src" "/tmp/arduino_build_643240/sketch/sketch_jul24a.ino.cpp" -o "/tmp/arduino_build_643240/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/jca/arduino-1.8.5/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_643240/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/cores/arduino" "-I/home/jca/.arduino15/packages/arduino/hardware/avr/1.6.21/variants/eightanaloginputs" "-I/home/jca/arduino-1.8.5/libraries/LiquidCrystal/src" "/tmp/arduino_build_643240/sketch/sketch_jul24a.ino.cpp" -o "/tmp/arduino_build_643240/sketch/sketch_jul24a.ino.cpp.o"
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino: In function 'void wait(int)':
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:45:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (millis()<FinishTime){
                    ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino: In function 'void Check_Pressed()':
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:142:37: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if (ButtonPressed and (RedPressed and BluePressed or YellowPressed and RedPressed
                                     ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:143:19: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or RedPressed and GreenPressed or GreenPressed and BluePressed
                   ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:143:52: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or RedPressed and GreenPressed or GreenPressed and BluePressed
                                                    ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:144:21: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or GreenPressed and YellowPressed or BluePressed and YellowPressed
                     ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:144:54: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or GreenPressed and YellowPressed or BluePressed and YellowPressed
                                                      ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:145:36: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or RedPressed and GreenPressed and YellowPressed
                                    ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:146:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or YellowPressed and GreenPressed and BluePressed
                                       ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:147:38: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or YellowPressed and BluePressed and RedPressed
                                      ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:148:37: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or GreenPressed and BluePressed and RedPressed
                                     ^
/tmp/arduino_modified_sketch_790328/sketch_jul24a.ino:149:55: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     or YellowPressed and GreenPressed and BluePressed and RedPressed)){
                                                       ^
Compiling libraries...
Compiling library "LiquidCrystal"
Using previously compiled file: /tmp/arduino_build_643240/libraries/LiquidCrystal/LiquidCrystal.cpp.o
Compiling core...
Using precompiled core
Linking everything together...
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "/tmp/arduino_build_643240/sketch_jul24a.ino.elf" "/tmp/arduino_build_643240/sketch/sketch_jul24a.ino.cpp.o" "/tmp/arduino_build_643240/libraries/LiquidCrystal/LiquidCrystal.cpp.o" "/tmp/arduino_build_643240/../arduino_cache_847178/core/core_arduino_avr_nano_cpu_atmega328_a33c4f3b2bfd78a02235ef6638399a0c.a" "-L/tmp/arduino_build_643240" -lm
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "/tmp/arduino_build_643240/sketch_jul24a.ino.elf" "/tmp/arduino_build_643240/sketch_jul24a.ino.eep"
"/home/jca/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom  "/tmp/arduino_build_643240/sketch_jul24a.ino.elf" "/tmp/arduino_build_643240/sketch_jul24a.ino.hex"
Using library LiquidCrystal at version 1.0.7 in folder: /home/jca/arduino-1.8.5/libraries/LiquidCrystal 
Sketch uses 5962 bytes (19%) of program storage space. Maximum is 30720 bytes.
Global variables use 497 bytes (24%) of dynamic memory, leaving 1551 bytes for local variables. Maximum is 2048 bytes.

You cut off the beginning of the error message where is says what file and what line caused the error.

You seem to be compiling for an Arduino DUE board. Is that your desired target?

yes I am using an Arduino Due and this is the entire error message:

error: conflicting declaration of C function 'char* utoa(long unsigned int, char*, int)'
./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:sam:arduino_due_x_dbg -build-cache /tmp -build-path /tmp/506770881/build -verbose -libraries /tmp/506770881/custom -libraries /tmp/506770881/pinned /tmp/506770881/Color_Combo_Lock_

Using library liquidcrystal_1_0_7 at version 1.0.7 in folder: /home/ubuntu/opt/libraries/latest/liquidcrystal_1_0_7

In file included from /home/ubuntu/opt/cores/arduino/sam/cores/arduino/Arduino.h:35:0,

from /tmp/506770881/build/sketch/Color_Combo_Lock_.ino.cpp:1:

/home/ubuntu/opt/cores/arduino/sam/cores/arduino/itoa.h:34:14: error: conflicting declaration of C function 'char* utoa(long unsigned int, char*, int)'

extern char* utoa( unsigned long value, char *string, int radix ) ;

^~~~

In file included from /home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdlib.h:11:0,

from /home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/cstdlib:75,

from /home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/stdlib.h:36,

from /home/ubuntu/opt/cores/arduino/sam/cores/arduino/Arduino.h:24,

from /tmp/506770881/build/sketch/Color_Combo_Lock_.ino.cpp:1:

/home/ubuntu/opt/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdlib.h:225:8: note: previous declaration 'char* utoa(unsigned int, char*, int)'

char * _EXFUN(utoa,(unsigned, char *, int));

^

exit status 1

So, on line 24 Arduino.h includes stdlib.h, which on line 36 includes cstdlib which on line 75 includes stdlib.h which on line 11 includes stdlib.h (ITSELF?!?) which, on line 225, declares the function as:
'char* utoa(unsigned int, char*, int)'

But on line 35, opt/cores/arduino/sam/cores/arduino/Arduino.h, includes itoa.h which, on line 34, declares the function as:
'char* utoa(long unsigned int, char*, int)'

It looks like the problem might be caused, in part, by /include/c++/7.2.1/stdlib.h including /include/c++/7.2.1/cstdlib which includes /include/stdlib.h (a DIFFERENT stdlib.h). It's the SECOND version of stdlib.h that contains the conflicting declaration. Perhaps the question is, why did cstdlib.h include a different stdlib.h than the one already included?

I am sorry but I dont really understand how I can fix this. There is no error if I using another board other than the due.

Which SAM boards version do you have? This problem is fixed in the current version.