"adam hamflett" <[EMAIL PROTECTED]> wrote in message
news:10613@palm-dev-forum...
>
> Im developing a large palm applictaion. It is now greter than the
> maximum allowed limit of 65505 bytes (or something like that).
>
> I was woundering how to create a library which i could call on.
Adam, you can put functionality in a shared library. This is basically like
a Windows DLL (Palm's NetLib is a shared library). This is a great way to
reduce the size of your code, but IMHO you should only put code that will be
reused by more than one app in a shared library. For example, say you write
some compression routines and interface them with CompressData() and
UncompressData() at the highest level. If you stuff your compression code
into a shared library, any app could call into these functions if they knew
about them.
I think you're probably looking to convert your app from a single-segment
app to a multi-segment app. This refers to the CODE segment -- a single
code segment can't exceeds 64k - 22 bytes. It sounds like this is where you
are.
It's easy to convert to a multi-segment app in Codewarrior. I'm not sure if
that's the IDE you use for Palm development. If so, check out
Targeting_Palm_OS.pdf in your Metrowerks dox folder, page 47. In a
nutshell:
1) Make sure you are linking to "MSL Runtime Palm OS X(i).lib", and this
must go in the first (topmost) Segment (switch to the 'Segments' tab in the
project window). Additionally, your PilotMain() routine must also be in
this.
2) Make sure the Linker : 68K Linker : Link Single Segment is NOT checked
in your project settings
3) Create a new segment, and drag some of the existing code modules into
it.
If you get 16-bit offset link errors, it means you need to arrange the code
modules in the two segments such that no function calls another function
that is greater than 64kbytes away.
Good luck,
-Jeff Ishaq
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/