> -----Original Message-----
> From: Dilek �zg� 
> 
> 
> Hi.
> I use to print function (in Symbol SDK Support).
> 
> extern "C" {
>  #include "PtPrint.h"
> }
> 
> When my program size increased , Its give me errors
> "
> Link Error : Starter.cpp : 'PrinterOpen()' 16-bit code reference to
> 'ptOpenPrinter' is out of range"
> 
> 
> How can I do that.
> Thanks

This error is normally due to a jump instruction to an address of a function that lies 
beyond the normal address range, which is 32KB from the current location. You can 
avoid the error by adjusting the type of memory model that you are using within the 
project. There are three memory models that are supported by CodeWarrior for Palm 
version 8: small,large, and smart. 

The large memory model actually generates a series of instructions that allows you to 
make function calls beyond the 32KB range as opposed to the single jump instruction 
that is used in the small model. The smart model is a combination of the small and the 
large model in which the compiler will try to use the small model wherever it can in 
order to avoid the code bloat caused by the large model. The code model can be changed 
in the 68K Processor panel in the target settings for the project.

However, you should try to avoid using the smart or large memory models if possible 
for performance reasons and to avoid unnecessary code bloat. One way to do this would 
be to try rearranging your code in the Link Order tab of the IDE project window in 
order to reduce some of the distance between certain function calls.

Vinu  

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to