This snippet from  the CodeWarrior for Palm Computing platform FAQ
(http://www.metrowerks.com/pda/palm./faq) might help:

7.2 When building my application the linker reports "16-bit reference out of
range." How do I fix this? (Typically this occurs to users who have had a
large application working for some time and have just added "a little more
code" to the application.)

Due to limitations in the Palm OS, applications cannot make jumps of more
than 32K (usually called "near" or "small" model on 68K series processors).
The error message indicates that someplace in your code you are calling a
function in another block of code that is more than 32K away in the compiled
application. Since the jump is further than the Palm OS allows, the linker
cannot resolve the reference. Here are ways to work around the limitation:

Change the link order of the application
The linker error message will tell you what function in your code was
calling for the function which was too far away. You can determine what
source file the calling and called functions are in and move the source
files closer together in the link order (place the files closer together in
the Segments view of the project, under the Segments tab of the project
window). In many cases a little reorganization of the link order can solve
the problem. However, as you continue to write code for the app and its gets
larger eventually it may not be possible to reorganize the source file link
order to eliminate the problem.

Set the compiler to "Smart" code model
Set the Code Model popup menu of the 68K processor preference panel (in the
Target settings window) to "Smart." This will allow the compiler to resolve
the out of range references itself. There is a size penalty associated with
this, for more info see the explanation of code models in "What does the
Code Model popup do?" below.

Reorganize/Rewrite your code itself
Palm makes several suggestions on how to write your application to avoid
these issues by using jump islands or jump tables. For information see the
following document from Palm http://www.palm.com/devzone/tn_32kj.html.

Hope this helps.

Rgds,
JK Lam
Metrowerks Technical Support

----- Original Message -----
From: Qun Wang <[EMAIL PROTECTED]>
To: Palm Developers Forum List <[EMAIL PROTECTED]>
Sent: Thursday, July 01, 1999 10:42 PM
Subject: Question about MemPtrNew


> Hi, all.
> I am using CodeWarrior5.0 on Win95 developing Palm application.
> I encountered a weird problem.
> Whenever I have more than 60 calls to MemPtrNew function CodeWarrior
> give me
> a Link error: Link Error   : (Starter.c: 'AppStart' 16-bit code
> reference to 'OpenOrCreateDB' is out of range.)
> If I comment out one MemPtrNew call then everything is fine again.
> Does anybody know what's going on?
> Any hint is appreciated!
>
> -QW
>
>
>
>
>

Reply via email to