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 in COMPILING

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







ERROR in COMPILING
PostPosted: Wed May 09, 2007 6:41 am     Reply with quote

Hey pals, I'm getting an error while compilin a piece of code the error states as below

Error 160: EXTERNal Symbol not found s

the line it points is the last possible line in the code.
I dunno what the error is. Pls help me on this.
Mahesh
Guest







more info
PostPosted: Wed May 09, 2007 6:49 am     Reply with quote

just now noticed tat the error its showin in the line where no code is there..
i mean code stops at line 371
error line is 373!! but at line 373 there is nothin,,
How to debug this.. pls help urgent
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

Re: more info
PostPosted: Wed May 09, 2007 1:19 pm     Reply with quote

Mahesh wrote:

How to debug this.. pls help urgent


no one can help you unless you post your code.
we are not telepathic, we can't see into your PC, and we can't remotely debug your program.

use the Code button (located above the text editing box) when replying, and post your code.

jds-pic
Mahesh
Guest







Code...
PostPosted: Wed May 09, 2007 11:41 pm     Reply with quote

Here is the part of code.. the full code is too long.. so i'm postin the part where error is comin.,.

#include <16F877a.h>
#include <string.h>
#include <stdlib.h>
#use delay (clock=20000000)
#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7, stream=com_1)

#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT,PUT,NOLVP

#byte RCREG=0x1A
#bit CREN=0x18.4
#bit OERR=0x18.1
#bit RCIF=0x0c.5
#bit RCIE=0x8c.5
#bit GIE=0x0b.7
#byte PORTA=0x05

#define serial_error() OERR // USART error
#define serial_fix() {CREN=0;CREN=1;}
#define serial_rx_ready() RCIF

extern byte s[77];
extern byte msg[7];
extern byte i,l;
extern byte status1[18];
extern byte mloc;


These extern byte variables are used in the source code file.. i've only one source file which contains 5 functions apart from main..
each function uses one variable... the code compiles properly without errors if i compile it removing the extern keyword.. is it ok if i remove the extern key word and compile???
pls help...
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu May 10, 2007 1:44 am     Reply with quote

Quote:
These extern byte variables are used in the source code file.. i've only one source file which contains 5 functions apart from main..
'Extern' and 'only one source file' are a contradiction. You only use the extern keyword to define variables that are declared in another file or library, i.e. with 'extern' you make the type of the variable known to the compiler when the real variable is not accessible now because it is defined in another file.

My guess is you are mixing global and local variables. The declaration of a global variable is the same as for a local variable, except that it is not declared within a function but at the global level/scope. Yes, you can, and should, remove the extern keyword to fix the error.
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