Page 1 of 1

Linker error, symbol definition?

PostPosted: Tue Jun 28, 2005 12:30 am
by DFx_Tech
Hi Andrew,

I have a very strange error that appears when I set the default storage class to Static rather than the default of Auto:

MPLINK 3.93, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - could not find definition of symbol '__OSCreateTask:2' in file 'C:SALVOPRJSG-RX(Dual)main.o'.
Errors : 1

Set to Auto I get a successful compilation instead.

My code does have a error in it as I’m getting stack overflows (I assume that’s the cause of the resets, the ICD2 can't see the stack) with only one light flashing task as a test.

I was hoping that setting Static would show if it was a variable-related problem but I'm not quite sure exactly what I’m seeing.

-Jon


Re: Linker error, symbol definition?

PostPosted: Tue Jun 28, 2005 2:14 am
by DFx_Tech
I've just tried setting Static on another Salvo based product that we are actualy shipping and I get similar errors...argh!

I hope this is not a coding mistake I've been making for a long time, although the product we are shipping passed a three month test so maybe this is a phantom error?


Re: Linker error, symbol definition?

PostPosted: Tue Jun 28, 2005 6:56 am
by aek
Hi Jon.

I built tu5lite and tu5pro with the default storage class set to static, and I see what's going on ...

It's not a phantom error -- it's that you are doing a library build with a library that was not built with the static default storage class.

All of the Salvo libraries are built with the auto default storage class. Therefore when you link your static-default-storage-class code (and Salvo's mem.c) with the Salvo library (built with auto default stoarge class), the linker can't find the symbols for the local variables and/or function parameters in Salvo's API services that "ought to be there" because of the static default storage class being applied to the entire project.

So, either leave it as auto default storage class in a Salvo project done as a library build, or do a Salvo source-code build, or generate your own custom Salvo library (which might be non-trivial, as applying the -scs command-line option requires changes to the Salvo makefiles, I believe).

I'll add a note to RM-MCC18 that the libraries are built using the auto default storage class.

------------------

[This message has been edited by aek (edited June 28, 2005).]


Re: Linker error, symbol definition?

PostPosted: Tue Jun 28, 2005 7:19 am
by aek
I've updated RM-MCC18.PDF to cover the issues surrounding the default storage class.

------------------


Re: Linker error, symbol definition?

PostPosted: Tue Jun 28, 2005 7:35 am
by DFx_Tech
Thanks for the quick reply, I had assumed it was configuration related, but I had visions of not properly enabling something in all the previous projects

I don't think it's worth me recompiling as static if it involves fidling with the makefiles, I'll defer debugging until the new pod for my ICE2000 arrives later this week (I can't stand the ICD2!).

-Jon

[This message has been edited by DFx_Tech (edited June 28, 2005).]


Re: Linker error, symbol definition?

PostPosted: Tue Jun 28, 2005 7:59 am
by aek
Is the ICE2000 still well-supported in MPLAB 7 and Win2k/XP?

We have an ICE2000 here ...

------------------


Re: Linker error, symbol definition?

PostPosted: Wed Jun 29, 2005 1:47 am
by DFx_Tech
It's listed as fully supported under MPLAB 7.20 (I suppose I'll find out soon enough ), and I know of people that have had it running under WinXP PRO with only a little hassle.

Although I'm still running 98SE as our PCB design package/SPICE/most-other-things won't run under XP as the parallel port weirdness means they can't communicate with their dongles (why Microsoft thought it was a good idea to restrict parallel comms I'm not quite sure).


Re: Linker error, symbol definition?

PostPosted: Wed Jun 29, 2005 6:53 am
by aek
Ha! You're not alone. We also run our capture and PCB design under Win98!

Thanks,

------------------