View previous topic :: View next topic |
Author |
Message |
Mahesh Guest
|
ERROR in COMPILING |
Posted: Wed May 09, 2007 6:41 am |
|
|
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 |
Posted: Wed May 09, 2007 6:49 am |
|
|
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
|
Re: more info |
Posted: Wed May 09, 2007 1:19 pm |
|
|
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... |
Posted: Wed May 09, 2007 11:41 pm |
|
|
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
|
|
Posted: Thu May 10, 2007 1:44 am |
|
|
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. |
|
|
|