Searching \ for '[PIC] MCC18 Linker Error' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'MCC18 Linker Error'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] MCC18 Linker Error'
2006\11\21@054332 by Harold Hallikainen

face
flavicon
face
I'm getting this error when compiling a C program with Microchip C18:

MPLINK 4.04, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'GoTimersIsr' in file
'C:\ProductDesigns\Iq512\061116\isr.o'.
Errors    : 1


The fact that it is a linker error instead of a compile error makes me
think it is not a header file problem. isr.c is calling GoTimersIsr which
is defined in GoTimers.asm. Some of that code is:


MyCode        code

GoTimersIsr
 banksel  FadeOutScale                ; set bank select for ram used here
 btfsc           FadeDelay+1,7        ; skip next if FadeDelay positive

... more code...


       global GoTimersIsr

               end


The fact that the linker is not finding it makes me think I'm missing the
global command... But there it is!

So, ideas? I'm getting tired of hitting F10 over and over again and
getting the same error!

THANKS!

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2006\11\21@061820 by Jan-Erik Söderholm

face picon face
Have you tried to put the "global" at the start
(before the function/label) of GoTimers.asm ?

Not saying that that's the error, but that's what
I would try... :-)

Jan-Erik.

Harold Hallikainen wrote :

{Quote hidden}

2006\11\21@072224 by David Jolley

flavicon
Jan-Erik Söderholm wrote:
> Have you tried to put the "global" at the start
> (before the function/label) of GoTimers.asm ?
>
> Not saying that that's the error, but that's what
> I would try... :-)
>
> Jan-Erik.
>  
And if that doesn't work, try decorating the GoTimersIsr label with an
underscore, viz:

_GoTimersIsr

Most other C compilers (that I've come across) decorate functions with
an underscore.  I don't believe that C18 is any different in this
respect.  So you have to do all the work in your assembly module to
conform to the environment that the C compiler expects.
Additionally, if you're calling this function from C, then I'd also
check the C compilers output to see what function prologue and epilogue
are generated in addition to the code that gets generated because of the
C you've written (i.e. the implementation of the C18's calling
convention).  Your initial banksel statement may be enough, but check,
just to make sure, you may be required to restore the bank originally
used by the C compiler when you got called before you exit the routine.

Your Mileage May Vary; my main experience is C on Microcomputers (where
prologue and epilogue code tends towards the baroque), although I've had
a few minor successes with C18 on PICs in the last couple of years.  But
I've never tried to interface assembly and C on a PIC.

Regards

Dave Jolley.

2006\11\21@074507 by Alan B. Pearce

face picon face
>And if that doesn't work, try decorating the GoTimersIsr label with
>an underscore, viz:
>
>_GoTimersIsr
...

and the other possibility is to embed assembly in the C program.

2006\11\21@104907 by WH Tan

picon face
2006/11/21, Alan B. Pearce:
>
> and the other possibility is to embed assembly in the C program.


...to add to the list...

Make sure that you don't have c and asm module that share the same
name: example isr.c and isr.asm.


Best regards,

--
WH Tan

2006\11\21@175615 by Harold Hallikainen

face
flavicon
face
Thanks for the responses. Turns out that I had the same source file name
(with different extensions) for the C and ASM code that deals with this
portion of the project. So, I believe the object files ended up with the
same names, and one overwrote the other. I changed the asm file to
GoTimersAsm.asm and all is well.

Thanks!

Harold



--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...