C18 linker error.. Help please..

Status
Not open for further replies.

MrNobody

New Member
Hi,
I tried to compile my code in C18 but have a linker error. Below is the error.

MPLINK 4.13, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - section '.udata_MainDemo.o' can not fit the section. Section '.udata_MainDemo.o' length=0x0000011b
Errors : 1

I use alot of printf("anystring") and maybe that is the thing that caused it. Please advice how I can solve it..
Thanks..

By the way, the memory is not even half full..
 
Wild guess - you have some array or other thing (printf?) using more RAM than there is in one bank (length 0x11b). You can probably only fit 0x100 in a bank.

If this is the case, you'll have to rewrite so it either is smaller, or automatically moves to another storage space in the next bank.

I could be wrong. I use BoostC. I've dabbled in PICC and C18, but am not as familiar with them as BoostC.
 
Thanks..
My printf data is only 16 bytes in size but I have lots of them. However, I do not store it in variable. I just directly type printf("anystring"); How can I make it smaller or move it to other banks..?

Please advice.. Thanks.
 
C18 Link error

The message is very general. There are a lot of error sources for it. Another is, the Linker will include the section a second time. Search your directories for this specific .o module and delete the name from the Project Window, if it is defined in "object files".
Is only a suggestion. Good luck!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…