Dear Community,
I am new to PIC and microcontrollers and just started to work with mikroC Pro.
Now following problem occurred. It is not possible to compile following snippet:
Code: Select all
void main() {
ANSEL = 0;
int a;
while(1){}
}
The compiler shows following:
0 1 mikroCPIC1618.exe -MSF -DBG -pP16F887 -DL -O11111114 -fo8 -N"D:\Ablage\MicroController\MikroElektronika\complieError\test.mcppi" -SP"C:\Programme\Mikroelektronika\mikroC PRO for PIC\defs\" -SP"C:\Programme\Mikroelektronika\mikroC PRO for PIC\Uses\P16\" -SP"D:\Ablage\MicroController\MikroElektronika\complieError\" "main.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl"
0 125 All files Preprocessed in 31 ms
0 121 Compilation Started main.c
3 315 Invalid expression main.c
2 400 ; expected, but 'int' found main.c
3 422 '}' expected ';' found main.c
4 312 Internal error '' main.c
0 102 Finished (with errors): 30 Mai 2009, 20:08:26 test.mcppi
If there is only one of the lines "ANSEL=0;", or "int a;" it works.
For me, this is very strange. Can anybody tell me, what I am missing.
Thank you.
Best regards,
oru