Pumpkin, Inc.

Pumpkin User Forums

Linker error, symbol definition?

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Linker error, symbol definition?

Postby DFx_Tech » Tue Jun 28, 2005 12:30 am

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

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Linker error, symbol definition?

Postby DFx_Tech » Tue Jun 28, 2005 2:14 am

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?

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Linker error, symbol definition?

Postby aek » Tue Jun 28, 2005 6:56 am

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).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Linker error, symbol definition?

Postby aek » Tue Jun 28, 2005 7:19 am

I've updated RM-MCC18.PDF to cover the issues surrounding the default storage class.

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Linker error, symbol definition?

Postby DFx_Tech » Tue Jun 28, 2005 7:35 am

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).]

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Linker error, symbol definition?

Postby aek » Tue Jun 28, 2005 7:59 am

Is the ICE2000 still well-supported in MPLAB 7 and Win2k/XP?

We have an ICE2000 here ...

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Linker error, symbol definition?

Postby DFx_Tech » Wed Jun 29, 2005 1:47 am

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).

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Linker error, symbol definition?

Postby aek » Wed Jun 29, 2005 6:53 am

Ha! You're not alone. We also run our capture and PCB design under Win98!

Thanks,

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron