View previous topic :: View next topic |
Author |
Message |
arup Guest
|
Compilation failed -Error :#DEVICE required before this line |
Posted: Wed Jan 23, 2008 7:20 am |
|
|
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
|
|
Posted: Wed Jan 23, 2008 8:23 am |
|
|
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 |
Posted: Wed Jan 23, 2008 8:30 am |
|
|
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
|
|
Posted: Wed Jan 23, 2008 1:37 pm |
|
|
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 ...
Franck. |
|
|
|