Arduino mega and FrequencyTimer2

Hi i have the Arduino mega with atmega 1280
this is my code:

#include <FrequencyTimer2.h>
int pin_ir_led=11;
int pin_ir_rec=8;
int pin_led_1=6;
int pin_led_2=7;

void setup ()
{
FrequencyTimer2::setPeriod(38500L);
FrequencyTimer2::enable();
pinMode(pin_led_1,OUTPUT);
pinMode(pin_led_2,OUTPUT);
pinMode(pin_ir_rec,INPUT);
}
while (digitalRead (pin_ir_rec)==LOW){
digitalWrite(pin_led_1,HIGH);
digitalWrite(pin_led_2,LOW);
delay(2000);
}
digitalWrite(pin_led_1,LOW);
digitalWrite(pin_led_2,HIGH);
}

and this is the error

FrequencyTimer2.cpp:51: error: ‘TIMSK’ was not declared in this scope
FrequencyTimer2.cpp:51: error: ‘OCIE2’ was not declared in this scope
FrequencyTimer2.cpp:52: error: ‘TIMSK’ was not declared in this scope
FrequencyTimer2.cpp:52: error: ‘OCIE2’ was not declared in this scope
FrequencyTimer2.cpp: In static member function ‘static void FrequencyTimer2::setPeriod(long unsigned int)’:
FrequencyTimer2.cpp:99: error: ‘TCCR2’ was not declared in this scope
FrequencyTimer2.cpp:102: error: ‘OCR2’ was not declared in this scope
FrequencyTimer2.cpp:103: error: ‘COM20’ was not declared in this scope
FrequencyTimer2.cpp: In static member function ‘static long unsigned int FrequencyTimer2::getPeriod()’:
FrequencyTimer2.cpp:113: error: ‘TCCR2’ was not declared in this scope
FrequencyTimer2.cpp:114: error: ‘OCR2’ was not declared in this scope
FrequencyTimer2.cpp: In static member function ‘static void FrequencyTimer2::enable()’:
FrequencyTimer2.cpp:150: error: ‘TCCR2’ was not declared in this scope
FrequencyTimer2.cpp:150: error: ‘COM20’ was not declared in this scope
FrequencyTimer2.cpp: In static member function ‘static void FrequencyTimer2::disable()’:
FrequencyTimer2.cpp:160: error: ‘TCCR2’ was not declared in this scope
FrequencyTimer2.cpp:160: error: ‘COM20’ was not declared in this scope

i have read this http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239820770

and trying this

#if defined(AVR_ATmega328P)
// A mega328 is mostly like an mega168, in terms of peripherals
#define AVR_ATmega168 1
#endif

but it dosn’t work plz help…

Pin _ir_led is a infared emmiting diode
Pin_ir_rec is a receiver for infrared