complie error on new project?

General discussion on mikroC.
Post Reply
Author
Message
Torpong
Posts: 3
Joined: 27 Jul 2005 08:01

complie error on new project?

#1 Post by Torpong » 27 Jul 2005 08:09

I use the mikro c 2.0.0.3 Demo. When I compling in example project it OK but when i copy source in example file to new project it not ok. It a same code same device and clock. Please help me.

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

Re: complie error on new project?

#2 Post by pizon » 27 Jul 2005 10:15

- Always use the latest version. Current version is 2.1.0.0, so please upgrade.
- Please be more specific. Which example is it about? Which device (PIC, clock, config settings) are you using? Which error does the compiler report?
pizon

Torpong
Posts: 3
Joined: 27 Jul 2005 08:01

#3 Post by Torpong » 28 Jul 2005 02:15

More information

- Device = 16F877 and a8F458
- Clock = 10 MHz, 20 MHz
- Config setting is default setting
(High speed osc = ENABLE,
Watch Dog Timer = DISABLE,
Low voltage programmer = DISABLE )
- I can complied all sample code (Open project from example folder and complie)

My code (copy from mikro c help)
unsigned short i;

void main() {

// Initialize USART module (8 bit, 2400 baud rate, no parity bit..)
Usart_Init(2400);

do {
if (Usart_Data_Ready()) { // If data is received
i = Usart_Read(); // Read the received data
Usart_Write(i); // Send data via USART
}
} while (1);
}//~!
compiler report
D:/temp/MikroC/Uart/Uart2.c:15: error: End of input with no newline, skipped the line
}//~!
1 error in preprocessor.

Line/Coiumn-----Message No.--------Message Text
1:15------------------15------------------Invalid expresion
1:14------------------11------------------';' expected but found
1:15------------------12------------------Internal error
My OS is Windows XP Service Pack 2


Thank you verymuch

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

#4 Post by pizon » 28 Jul 2005 08:13

You need to add a newline (Carriage Return) at the end of your source file. Please take a look at the following topic: http://www.mikroe.com/forum/viewtopic.p ... or+newline
We'll post this on the FAQ as well.
pizon

Torpong
Posts: 3
Joined: 27 Jul 2005 08:01

#5 Post by Torpong » 30 Jul 2005 02:26

thank you very much for your help. :D

Post Reply

Return to “mikroC General”