CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Compilation failed -Error :#DEVICE required before this line

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arup
Guest







Compilation failed -Error :#DEVICE required before this line
PostPosted: Wed Jan 23, 2008 7:20 am     Reply with quote

Dear Sir,

I am just started using PCWHD CCS C compiler with IDE. My project is multifile project based on PIC16F877. This includes :

1) var.h -> global definition of all variables and functions used in the project.
2) ext_var.h -> extern definition of all variables and functions.
3) main.c -> main file. I will call function defined in other module in main.
4) init.c -> initialization
5) lcd.c -> display
6) global_def.h -> includes all #defines and Device header file.


In IDE i have chosen multiple compilation unit and link seperately option.

When i have compiled init.c compiled OK.But when i have compiled lcd.c it compiles with an error: #DEVICE required before this line . When i double clicked on this line it takes the cursor to a extern definition of a variable in ext_var.h file. Why so happening??
Pls note :In the same way i worked with Hi-Tech C demo version without any problem.

Could anybody help me in this regard.

Thanks,
Arup
future_
Guest







PostPosted: Wed Jan 23, 2008 8:23 am     Reply with quote

the first line in your source file must be like
#device PIC18F4620 *=16 ADC=8
arup
Guest







Compilation failed -Error :#DEVICE required before this line
PostPosted: Wed Jan 23, 2008 8:30 am     Reply with quote

future_ wrote:
the first line in your source file must be like
#device PIC18F4620 *=16 ADC=8


Sir,

My device is 16F877A and I have 3 source files.Do i need to include it in every source file??

thanks
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Wed Jan 23, 2008 1:37 pm     Reply with quote

Hello,
When you are using a multi compilation units, you have to put the define of your device at the beginning of .c files

#device PIC16F877A

I've tried to make a multi compilation project for 2 weeks (CCS 4.064 PIC24H).
At the end I was able to compile but not able to debug (error message).

I've sent an Email to CCS support, they answer me to wait.
It was 1 month ago...

I hope you will be more lucky than me Sad ...

Franck.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group