# Error interrupt funcition with MPLAB X v5.30 XC8

I am programming a pic18f4550. When I try to compile the project I get two errors.

According to what the console indicates, they are caused by the following function.

void interrupt interupciones()
{
//do something.
}


The errors are the following:

control.c: 126: 6: error: variable has incomplete type 'void' void interrupt interrupts ()

control.c: 126: 15: error: expected ';' after top level declarator void interrupt interrupts ()

I have tried the following but the error persists.

void __interrupt my_interr(void)
{
//do something.
}


If I remove the interrupt from the function then the project compiles correctly.

But doing the simulation doesn't work.

• the error messages don't match your code; please actually post your code, at least from the names. Apr 12, 2020 at 19:22
• @MarcusMüller I'm guessing the OP ran the question through a translator and used the actual code, since "interupciones" means "interrupts". I think this is the actual code, just a translated question. Apr 12, 2020 at 19:48

In XC8, you need to define interrupts this way (the myISR can be changed to whatever you want):
void __interrupt() myISR(void)

Provided you are compiling against C99. The old void interrupt myISR(void) syntax is from XC8 2.00 or lower. They changed the way interrupts are defined after that. If you are not compiling against C99, you can also try void interrupt() myISR(void) { ... }.