troubleshooting help with arduino uno ide

hello i am trying to download the program to my arduino uno, however i keep getting the same error message no matter what i try.
here is the error code

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino/Genuino Uno.\

and here is my full code

void setup() {
  // put your setup code here, to run once:
int button = 1;
int led = 2;
int flare = 0;
int button2 = 3;
pinMode(1, INPUT);
pinMode(2, OUTPUT);
pinMode(3, INPUT);
button = digitalRead(1);
button2 = digitalRead(2);

}

void loop() {
  // put your code here, to run repeatedly:
int button = 1;
int led = 2;
int flare = 0;
int button2 = 3;
if (button == button2){
  digitalWrite(2, HIGH);
  digitalWrite(2, LOW);
}
}

thanks in advance,
manbat0213

int button = 1;
...
int button2 = 3;
if (button == button2){

What is wrong with this picture?

sorry, i'm still new to programming. i thought it would either return the HIGH/LOW value or the assigned value. i guess it was the second option

i fixed this, but i am still getting that same error message

here is the new code

void setup() {
int button = 1;
int led = 2;
pinMode(1, INPUT);
pinMode(2, OUTPUT);
pinMode(3, INPUT);
button = digitalRead(1);
int val = digitalRead(3);

}

void loop() {
int val = digitalRead(3);
int button = 1;
int led = 2;
int flare = 0;
int button2 = 3;
if (button == val){
  digitalWrite(2, HIGH);
  delay(1000);
  digitalWrite(2, LOW);
  delay(1000);
}

Where's does your loop function end?

Try to find an online tutorial about scope too.

okay, i will look up scope. also, i forgot to copy the end of the loop from the ide. I still need help getting it to work though

i originally tried putting the integers before the void setup(), but i kept getting an error until i moved it.

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'

collect2.exe: error: ld returned 1 exit status

This implies something is wrong with the IDE or board package installation - it’s failing to see/correctly use main.cpp from the core.

How this comes about on a fresh installation is not clear to me, nor is how to fix it.

other programs like the samples work

i figured it out i had to uninstall then reinstall the program