kurtb
Joined: 12 Mar 2009 Posts: 1
|
Error Help: A #DEVICE required before this line |
Posted: Thu Mar 12, 2009 6:05 pm |
|
|
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. |
|