C program (XC8) will not build..function declaration?

Status
Not open for further replies.
T

treez

Guest
Hello,
Do you know why this c program will not build.
Its in MPLAB.X.
The compiler is complaining about the set_ana_dig_ports() function....it says its a redeclared variable., says theres conflicting declarations

Here is the code...

 

Function declarations are expected to have a return type.
You'll want to write
Code:
void set_ana_dig_ports(void){
   ANCON0 = 0xFC;
   ANCON1 = 0x0F;
   ANCON2 = 0x00;
}
and so on.

The function parameters must be also identical to the previous declared prototype, otherwise the compiler assumes two different (overloaded) function versions.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…