View previous topic :: View next topic |
Author |
Message |
paxel
Joined: 17 Feb 2005 Posts: 1
|
problems when compiling old code |
Posted: Thu Feb 17, 2005 7:10 am |
|
|
Hi all,
We're trying to do some changes to an old project built around a PIC12C672 but when we take the code, open it up in PCW and then try to compile we get the error stated below:
Quote: | @const156
Seg 007B2-007B5, 0004 left, need 0007
0000
Seg 007B6-007BC, 0000 left, need 0007
0000
Seg 007BD-007D0, 0000 left, need 0007
0000
Seg 007D1-007E4, 0000 left, need 0007
0000
Seg 007E5-007EC, 0000 left, need 0007
0000
Seg 007ED-007F2, 0000 left, need 0007
0000
Seg 007F3-007FB, 0000 left, need 0007
0000
Seg 007FC-007FE, 0003 left, need 0007
0000
Seg 007FF-007FF, 0001 left, need 0007
0000
Seg 00000-00003, 0000 left, need 0007
0000
Seg 00004-00021, 001E left, need 0007
0000
Error[71] C:\projects\Attendo\radioButton\Software\PAT\PATAPP.C 967 : Out of ROM, A segment or the program is too large |
From what i understand from other post this has to do with the program code being to big to fit in the segments but this is code that has (supposedly) worked before.
Before we start changing code i'd like to now if the error can be contributed to different versions of compiler and/or IDE (or new/changed settings?).
The source code was last changed in April 2003 and we're using PCW IDE 3.219 and PCM 3.219
with regards,
Per
NNNN |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: problems when compiling old code |
Posted: Thu Feb 17, 2005 10:01 am |
|
|
paxel wrote: | Before we start changing code i'd like to now if the error can be contributed to different versions of compiler and/or IDE (or new/changed settings?).
The source code was last changed in April 2003 and we're using PCW IDE 3.219 and PCM 3.219
|
Sure, if the compiler doesn't compile the code the same! Always keep your compiler with your source. Using a newer compiler is a sure fire way to lose some of you hair. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 17, 2005 12:34 pm |
|
|
Quote: | The source code was last changed in April 2003 and we're using
PCW IDE 3.219 and PCM 3.219 |
Based on my records, the versions available in April 2003 would be
approximately 3.150 to 3.156. So that's the highest version you
could possibly be using at that time. You might have bought the
compiler months before that and it could be a lower version. |
|
|
Ttelmah Guest
|
|
Posted: Thu Feb 17, 2005 3:06 pm |
|
|
One thing you could try before using an older version, would be to change the optimisation setting of the compiler (#opt).
Best Wishes |
|
|
win_nie Guest
|
|
Posted: Tue Mar 08, 2005 1:57 pm |
|
|
Is there already a solution available?
I have the same problem with 3.218.
What i found out:
The problem is a function which returns a long (16 bit).
If i change it to int (8 bit) the code can be compiled without problems, but of course without the right functionality. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Mar 08, 2005 2:01 pm |
|
|
Yeah, make the code smaller so that it will fit. Big functions can be broken down into smaller ones so that it is easier to fit within pages. Try using #separate before each function to force the compiler not to try and "inline" it in the event that it is only called once. |
|
|
win_nie Guest
|
|
Posted: Tue Mar 08, 2005 2:49 pm |
|
|
Hi Mark,
the code (stored in several *.c and *.h files) can be compiled with an old version (3.137) without problems. The function which causes the trouble is really small. I already tried #separate before the function and before the other functions in the same code file. Still the same problem.
Do you have an idea why it works, if i just change the return value of the function from long to int?
Thank you for your help. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Mar 08, 2005 2:53 pm |
|
|
Comment out some lines in the function and see what happens. If it compiles, then start adding back lines until it doesn't. Go back one step and compile it again. Take a look at how much room is left in that page. If you are not getting what I am saying, then email me the files and I will take a look at it. |
|
|
win_nie Guest
|
|
Posted: Thu Mar 10, 2005 1:57 pm |
|
|
It seems that the old compiler generated more compact code. If i leave away some lines of code, it is possible to compile with the new compiler. |
|
|
|