[SOLVED+-] collect2.exe: error: ld returned 5 exit status. but strange

Hi Arduino Forum,
I'm new on Arduino Forum. I'm using Arduino 1.6.4
My problem is as seen in the topic, the same problem many people have, but a little bit different.
I've located the error in the code line that makes issues, I've done some test and the results are very anoying.
Here you have:
In fact, my code doesn't matter , but I'll post it. Now I'm programing a code that reads some characters and numbers arriving throught serial port from a XBee module device and set the respective variable values.

/* ****Comunicación Xbee ****
En este codigo se realiza la comunicación de los módulos Xbee para permitir manipular
parámetros del drone de forma inalámbrica

*/

// Declaración de variables de comunicación Xbee
char ch='0';
char lectura[8]={0,0,0,0,0,0,0,0};
char parametro[2]={0,0};
char medida[6]={0,0,0,0,0,0};
int poslect=0;
long valor;

// Declaración de variables provisional. Variables ya declaradas en el código principal.
int dT1,dT2,altura;
float alfa,pitch_referencia,roll_referencia,yaw_referencia,kp,ki,kd;

void setup() 
{
  Serial.begin(9600);
}

void loop() 
{
  if (Serial.available())
  {
    ch=Serial.read();
    Serial.println(ch);
    if (ch!='f')
    {
      lectura[poslect]=ch;
      ++poslect;
    }
    else
    {
      lectura[poslect]='\0';
      for (int i=0;i<=1;i++)
      {
        parametro[i]=lectura[i];
      }
      for (int i=0;i<=poslect-2;i++)
      {
        medida[i]=lectura[i+2];
      }
      valor=atol(medida);
      poslect=0;
      switch(parametro[1])
      {
        case 'a':    // Alfa. Filtro complementario
          alfa=valor;
          break;
        case 'l':    // Altura
          altura=valor;
          break;
        case 'x':    // Pitch Reference
          pitch_referencia=valor;
          break;
        case 'y':    // Roll Reference
          roll_referencia=valor;
          break;
        case 'z':    // Yaw Reference
          yaw_referencia=valor;
          break;
        case 'p':    // Ganancia proporcional del control PID. Kp
          kp=valor;
          break;
        case 'i':    // Ganancia integral del control PID. Ki
          ki=valor;
          break;
        case 'd':    // Ganancia derivativa del control PID. Kd
          kd=valor;
          break;

      }
      Serial.print("Parametro : ");
      Serial.print(parametro[0]);
      Serial.print(parametro[1]);
      Serial.print(" : ");
      Serial.println(valor);
    }
    Serial.print("Poslect : ");
    Serial.println(poslect); 
    Serial.print("Lectura : ");
    Serial.print(lectura[0]);
    Serial.print(lectura[1]);
    Serial.print(lectura[2]);
    Serial.print(lectura[3]);
    Serial.print(lectura[4]);
    Serial.print(lectura[5]);
    Serial.print(lectura[6]);
    Serial.print(lectura[7]);
    Serial.println(lectura[8]);
    Serial.print("Parametro : ");
    Serial.print(parametro[0]);
    Serial.println(parametro[1]);
    Serial.print("Medida : ");
    Serial.print(medida[0]);
    Serial.print(medida[1]);
    Serial.print(medida[2]);
    Serial.print(medida[3]);
    Serial.print(medida[4]);
    Serial.print(medida[5]);
    Serial.println(medida[6]);
    Serial.print("Valor : ");
    Serial.println(valor);  
    Serial.println("Siguiente caracter ");
  
  }
}

As I say that code doesn't really matter, the important part is this:

int poslect=0;

Arduino returns 5 exit status error.
I will add a new variable, not used in code.

int poslect=0;
int posicion=0;

Now It compiles well, although that variable is not used.

I add another needed variable to set de finish of a assignment

int poslect=0;
int posicion=0;
int terminado=0;

This variable "terminado" is still not used in the code but Arduino doesn't compile, it returns the same error.
What the f*&k??
I've been using this Arduino in this computer with this Windows XP with no new update for 4 months. The code is right, becouse I had used it but started to make this anoying behaviours. Windows have not changed, I've windows XP x86 (32 bits) and there are no more updates. Arduino is right becouse I can use any other code examples.
I've to send my proyect the next week and this stupid problems were not expected. I will be grateful If anyone could help me.
(Sorry for my bad english)

I've rewrite the full code in a new file and the problem is still there. I can't use a third int variable. I've try to agree a fourth variable int but in this case that doesn't fix the problem

EDIT:
I've continue with test and I've find a provisionally evasive way to avoid the error in that case.
I've added seven integer variables to 0

int posicion=0;
int terminado=0;
int poslect=0;
int entero3=0;
int entero4=0;
int entero5=0;
int entero6=0;
int entero7=0;

In fact, there are 11 integer variables. Don't forget

// Declaración de variables provisional. Variables ya declaradas.
int dT1,dT2,altura;

Then I can add 12,13,14,15 and there is no error!
I hope this helps someone.