collect2.exe: error: ld returned 5 exit status

Hello,
I’m trying to create program. It will display in sequence numbers on LED display. I have a code:

void setup() 
{
  pinMode(10,OUTPUT); //digit 1
  pinMode(11,OUTPUT); //digit 2
  pinMode(12,OUTPUT); //digit 3
  pinMode(13,OUTPUT); //digit 4
  
  pinMode(2,OUTPUT); //segment 1
  pinMode(3,OUTPUT); //segment 2
  pinMode(4,OUTPUT); //segment 3
  pinMode(5,OUTPUT); //segment 4
  pinMode(6,OUTPUT); //segment 5
  pinMode(7,OUTPUT); //segment 6
  pinMode(8,OUTPUT); //segment 7
  pinMode(9,OUTPUT); //dot
}
int numbers[10][7]
{
 {1,1,1,1,1,1,0}, 
 {0,1,1,0,0,0,0}, 
 {1,1,0,1,1,0,1}, 
 {1,1,1,1,0,0,1}, 
 {0,1,1,0,0,1,1}, 
 {1,0,1,1,0,1,1}, 
 {1,0,1,1,1,1,1}, 
 {1,1,1,0,0,0,0}, 
 {1,1,1,1,1,1,1}, 
 {1,1,1,1,0,1,1}  
};

void loop() 
{
  display(0, 10); delay(1000); 
  display(1, 10); delay(1000); 
  display(2, 10); delay(1000);
  display(3, 10); delay(1000);
  display(4, 10); delay(1000);
  display(5, 10); delay(1000);
  display(6, 10); delay(1000);
  display(7, 10); delay(1000); 
  display(8, 10); delay(1000);
  display(9, 10); delay(1000);
}

void display(int number,int digit)
{
  for(int x = 0; x < 9; x++)
  {
    if( numbers[number][x-2] == 1 )
    {
      DiodeOn(digit, x);
    } else
    {
      DiodeOff(digit, x);
    }
  }
}

void DiodeOn(int pin_digit,int pin_segment)
{
  digitalWrite(pin_digit,HIGH);
  digitalWrite(pin_segment,HIGH);
}

void DiodeOff(int pin_digit,int pin_segment)
{
  digitalWrite(pin_digit,LOW);
  digitalWrite(pin_segment,LOW);
}

and I got a error:

collect2.exe: error: ld returned 5 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.

Please help!

The current IDE won't run on Widows XP without some hacking. Search for that error message.

Microsoft stopped supporting Windows XP back in April 2014. It might be time to switch to something like Linux. :slight_smile:

Thanks! I'll check it on newer computer with Windows 8.