Getting a compiler error with my code, no idea whats causing it.

As stated, i am getting a compiler error and i have no idea whats causing the error. It looks right to me, though im not too experienced in coding in this language. The board im using is the Leonardo

#define DELAY            5  // Delay per loop in ms
 enum PinAssignments
 {
  encoderPinA = 0,
  encoderPinB = 1,
  encoderPinC = 3,
  encoderPinD = 2,
 
 };
//This is up to your pin wiring
 
 int encoderPos[] = {0,0};
 static boolean rotating[] = {false,false};
 
 boolean A_set = false;              
 boolean B_set = false;
 boolean C_set = false;              
 boolean D_set = false;
 
void setup()
{
  pinMode(4, INPUT_PULLUP);
  pinMode(A0, INPUT_PULLUP);
  pinMode(A1, INPUT_PULLUP);
  pinMode(A2, INPUT_PULLUP);
  pinMode(A3, INPUT_PULLUP);
  pinMode(A4, INPUT_PULLUP);
  pinMode(A5, INPUT_PULLUP);
  Keyboard.begin();
 
  pinMode(encoderPinA, INPUT_PULLUP);
  pinMode(encoderPinB, INPUT_PULLUP);
  pinMode(encoderPinC, INPUT_PULLUP);
  pinMode(encoderPinD, INPUT_PULLUP);
 
  attachInterrupt(0, doEncoderC, CHANGE);
  attachInterrupt(1, doEncoderD, CHANGE);
 
  attachInterrupt(2, doEncoderA, CHANGE);
  attachInterrupt(3, doEncoderB, CHANGE);
 
  Serial.begin(9600);
}
 
void loop() {
 
  if(digitalRead(4)==LOW){
    Keyboard.press('a');
  }
  if(digitalRead(4)==HIGH){
    Keyboard.release('a');
  }
  if(digitalRead(A0)==LOW){
    Keyboard.press('b');
  }
  if(digitalRead(A0)==HIGH){
    Keyboard.release('b');
  }
  if(digitalRead(A1)==LOW){
    Keyboard.press('c');
  }
  if(digitalRead(A1)==HIGH){
    Keyboard.release('c');
  }
  if(digitalRead(A2)==LOW){
    Keyboard.press('d');
  }
  if(digitalRead(A2)==HIGH){
    Keyboard.release('d');
  }
  if(digitalRead(A3)==LOW){
    Keyboard.press('i');
  }
  if(digitalRead(A3)==HIGH){
    Keyboard.release('i');
  }
  if(digitalRead(A4)==LOW){
    Keyboard.press('f');
  }
  if(digitalRead(A4)==HIGH){
    Keyboard.release('f');
  }
  if(digitalRead(A5)==LOW){
    Keyboard.press('g');
  }
  if(digitalRead(A5)==HIGH){
    Keyboard.release('g');
  }
  //Encoder Reset
  for(int i=0;i<=1;i++)
  {
    rotating[i] = true;
    if (encoderPos[i] != 0)
    {
      if(i==0)  Mouse.move(encoderPos[i],0,0);
      if(i==1)  Mouse.move(0,encoderPos[i],0);
 
      encoderPos[i] = 0;
    }
  }
 
  delay(DELAY);
}
 
void doEncoderA()
{
 
  if( digitalRead(encoderPinA) != A_set )
  {  
    A_set = !A_set;
 
    if ( A_set && !B_set )
      encoderPos[0] += 1;
 
    rotating[0] = false;  
  }
}
 
void doEncoderB()
{
 
  if( digitalRead(encoderPinB) != B_set ) {
    B_set = !B_set;
   
    if( B_set && !A_set )
      encoderPos[0] -= 1;
 
    rotating[0] = false;
  }
}
 
void doEncoderC()
{
  if( digitalRead(encoderPinC) != C_set )
  {  
    C_set = !C_set;
 
    if ( C_set && !D_set )
      encoderPos[1] += 1;
 
    rotating[1] = false;
  }
}

here is my compiler error

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c: In function 'init':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c:318:3: warning: #warning Timer 2 not finished (may not be present on this CPU) [-Wcpp]
  #warning Timer 2 not finished (may not be present on this CPU)
   ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c:327:3: warning: #warning Timer 2 not finished (may not be present on this CPU) [-Wcpp]
  #warning Timer 2 not finished (may not be present on this CPU)
   ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\Tone.cpp:212:12: warning: #warning this may not be correct [-Wcpp]
           #warning this may not be correct
            ^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBAPI.h:38:0,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:19:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: In function 'bool SendConfiguration(int)':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.h:285:91: warning: narrowing conversion of 'interfaces' from 'int' to 'u8 {aka unsigned char}' inside { } is ill-formed in C++11 [-Wnarrowing]
  { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED, USB_CONFIG_POWER_MA(500) }
                                                                                           ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:471:28: note: in expansion of macro 'D_CONFIG'
  ConfigDescriptor config = D_CONFIG(_cmark + sizeof(ConfigDescriptor),interfaces);
                            ^
avr-gcc: error: sketch_oct29a.cpp.o: No such file or directory
Error compiling.

What board and IDE version are you using?

Other than not having the doEncoderD() function, it compiled fine for my DUE

sorry i forgot to copy over the doEncoderD function

void doEncoderD()
{
  if( digitalRead(encoderPinD) != D_set ) {
    D_set = !D_set;
   
    if( D_set && !C_set )
      encoderPos[1] -= 1;

    rotating[1] = false;
  }

i am using the arduino leonardo board and the 1.6.5 ide. Sorry i cannot post any sooner as i am limited by 1 per 10 minutes

I have 1.6.5-r2 and it works fine using a Leonardo.

It's possibly a bug with your IDE.

Weird because when i downloaded 1.6.4 it gave me the same error, but when i downloaded 1.0.5 the error didn't appear, or so from what i saw.

Im downloading 1.6.5-r5 now.

avr-gcc: error: sketch_oct29a.cpp.o: No such file or directory
Error compiling.

Everything else was a warning… and then you get to this error, indicating that it didn’t find the .o file… (which should have been generated by the compiler) Yet why was that the case? What resulted in the compiler not creating the .o? Were there more errors above those that didn’t get copied?

sketch_oct29a.cpp.o

You didn't name your sketch with a .cpp file extension did you?

No i did not, that was directly from when i saved and created the code and compiled it

Ok using the new 1.6.5-r5 IDE, it compiles fine. No warning or errors. What did you save it as? Have you tried to copy and paste the sketch into a new window?

One more thing to check is to make sure you have the right board selected in the IDE.

okay i just retried it on a fresh new install and i still get the same warnings

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c: In function 'init':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c:318:3: warning: #warning Timer 2 not finished (may not be present on this CPU) [-Wcpp]
  #warning Timer 2 not finished (may not be present on this CPU)
   ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c:327:3: warning: #warning Timer 2 not finished (may not be present on this CPU) [-Wcpp]
  #warning Timer 2 not finished (may not be present on this CPU)
   ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\Tone.cpp:212:12: warning: #warning this may not be correct [-Wcpp]
           #warning this may not be correct
            ^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBAPI.h:38:0,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:19:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: In function 'bool SendConfiguration(int)':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.h:285:91: warning: narrowing conversion of 'interfaces' from 'int' to 'u8 {aka unsigned char}' inside { } is ill-formed in C++11 [-Wnarrowing]
  { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED, USB_CONFIG_POWER_MA(500) }
                                                                                           ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:471:28: note: in expansion of macro 'D_CONFIG'
  ConfigDescriptor config = D_CONFIG(_cmark + sizeof(ConfigDescriptor),interfaces);
                            ^

i looked in the library folder, is it because i have none installed?

hotfinwax: i looked in the library folder, is it because i have none installed?

No, a fresh install won't have any libraries in the library folder in the sketch folder if that's what you mean.

Are you absolutely sure you have the right board selected in the menu in the IDE?

Yes, it says Arduino Leonardo on COM1 on the bottom and in the tools for selecting. Here’s a screenshot of it http://prntscr.com/8wxcoi

I don't know if this matters but is your java up to date?

I am currently using Java 7 as i do not see a use to go above that. I wouldn't think the java would matter though

Well im out of ideas

I am currently using Java 7, but i didn't see a reason to go any higher than that. Also i wouldnt think that would affect this either, unless i am completely wrong

Sorry for the double post, didnt see it popup here