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

A #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
Jhon
Guest







A #DEVICE required before this line
PostPosted: Fri Jan 02, 2009 8:53 am     Reply with quote

Dear Sir,

I am just started using PCWHD CCS C compiler with IDE. My project is multifile project based on PIC16F873.

When i have compiled it shows with an error: Executing: "C:\Program files\Picc\CCSC.exe" +FM "Telephone01.c" +DF +LN +T +A +M +Z +Y=9 +EA *** Error 128 "C:\Documents and Settings\Admin\Desktop\TRY\pic1687x.h" Line 19(1,2): A #DEVICE required before this line 1 Errors, 0 Warnings.
Halting build on first failure as requested.


When i double clicked on this line it takes the cursor to a extern definition of a variable in. Before those code below,


/*
* Header file for the Microchip
* PIC 16F870
* PIC 16F871
* PIC 16F872 chip
* PIC 16F873 chip
* PIC 16F874 chip
* PIC 16F876 chip
* PIC 16F877 chip
* Midrange Microcontroller
*/

#if defined(_16F874) || defined(_16F877) || defined(_16F871)
#define __PINS_40
#endif

(error happen here)

static volatile unsigned char INDF @ 0x00;
static volatile unsigned char TMR0 @ 0x01;
static volatile unsigned char PCL @ 0x02;
static volatile unsigned char STATUS @ 0x03;
static unsigned char FSR @ 0x04;
static volatile unsigned char PORTA @ 0x05;
static volatile unsigned char PORTB @ 0x06;
static volatile unsigned char PORTC @ 0x07;
#ifdef __PINS_40
static volatile unsigned char PORTD @ 0x08;
static volatile unsigned char PORTE @ 0x09;
#endif

Why so happening??
I have try put #device PIC16F873 still fail.

Could anybody help me in this regard.

Thanks,

Jhon
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 02, 2009 11:57 am     Reply with quote

This is Hi-Tech C code. Hi-Tech code doesn't compile in CCS.

Here are header files that have the SFR register declarations for CCS:

For 16F:
http://www.ccsinfo.com/forum/viewtopic.php?t=20186
http://www.ccsinfo.com/forum/viewtopic.php?t=20697

For 18F:
http://www.ccsinfo.com/forum/viewtopic.php?t=14755
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