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

Error Help: 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
kurtb



Joined: 12 Mar 2009
Posts: 1

View user's profile Send private message

Error Help: A #DEVICE required before this line
PostPosted: Thu Mar 12, 2009 6:05 pm     Reply with quote

Hello,

I got just this error message when i compile it:

*** Error 128 "C\Program Files\PICC\Drivers\string.h" Line 34(1,2): A DEVICE required before this line

I couldn't find the reason of this error, yet.

I used 16F876.

    CCS PCWHD Complier
    IDE Version: 4.057
    PCB Version: 4.068
    PCM Version: 4.068
    PCH Version: 4.068
    PCD Version: 4.057
    with MPLAB IDE v8.10



And when i clicked the error message, it opens: string.h file

and goes line:

char *memmove(void *s1,char *s2,size_t n)
{



Here is the begining of the C code:

Code:
#include <pic.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#define __16F876
__CONFIG(WDTDIS & XT & UNPROTECT & LVPDIS & PWRTEN & LVPDIS & BOREN);
#define FOSC 3686400L
#define ENA_MOTOR_LEFT RA3             // enable engine on the left leg RA3
#define ENA_MOTOR_RIGHT RA2            // enable engine right leg RA3
#define BACKWARD_LEFT RA1              // rotation left engine
#define BACKWARD_RIGHT RA0             // rotation right engine
#define TRUE 1
#define FALSE 0
#define   MHZ   *1000L
#if   FOSC >= 12MHZ*1000L
 
#define   DelayUs(x)   { unsigned char _dcnt; \
           _dcnt = (x)*((FOSC)/(12MHZ*1000L)); \
           while(--_dcnt != 0) \
              continue; }
#else

#define   DelayUs(x)   { unsigned char _dcnt; \
           _dcnt = (x)/((12MHZ*1000L)/(FOSC))|1; \
           while(--_dcnt != 0) \
              continue; }
#endif

/*
 * Comms setup:
 */
 
#define BAUD 38400     
#define NINE 0                    /* Use 9bit communication?! FALSE=8bit */
#if NINE == 1
#define NINE_BITS 0x40
#else
#define NINE_BITS 0
#endif

#define DIVIDER ((int)(FOSC/(16UL * BAUD) -1))
#define HIGH_SPEED 1
#if HIGH_SPEED == 1
#define SPEED 0x4
#else
#define SPEED 0
#endif




If u need more information about the error or code subjects, please just ask.

I couldn't get rid of this error for a long time.

Thank in advance.

Regards.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 12, 2009 6:06 pm     Reply with quote

This is CCS, not Hi-Tech. You cannot drop a Hi-Tech program into CCS
and have it compile.
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