This must have been done a million times, but I am stumped. I need to add a new form, which will take my code over the 64k limit. So I need to convert my app to multi segments. I have studied everything I can find for the past two days, and I think I need just a few more clues. I am using CodeWarrior 9.3 for Palm OS, Prof Ed. (?build v.5.2.1283). I have created a new target, copied from my existing Debug target (in which I have temporarily commented out enough code so it still compiles into one segment). In the new target, I have moved my new form's code to its own segment.
In attempting compile, I've tried two different linkers, "Palm OS 68k" and (modeled on the CW multi-seg example) the "Macintosh 68k". The first gives a Link Error: PalmOS_Startup.cpp: '__Startup__' 16-bit code reference to 'PilotMain' is out of range. The second gives a Link Error: <appname>.rcp: Illegal object data in '<appname>.rcp'. Banging at the first one, I've tried the Small, Smart, and Large code models. I know this is a common error with the Small model when you go beyond the 32k jump. I have been using the Smart model for months; and remember, it still compiles fine as one segment! I've tried making extern functions of both my new form's HandleEvent function, and PilotMain. I've tried project types of 68k application; Standard, Expanded, and Expanded with A5 jumptable. I've tried "Merge Compiler Glue into Segment 1" both on and off. I of course have "Link Single Segment" unchecked. Working on the second one, I've looked through my <.rcp> file, and everything seems clean and needed. A Palm Whitepaper insists I need to change the runtime library from "StartupCode.lib" to "MSL Runtime Palm OS (xx).lib", but another web hit says this is obsolete after CW v6 and to use "PalmOSRuntime_2i_A5.lib". This library is already in place in both my original project, and the CW multi-seg example. CW Help says single- and multi-seg apps used different libraries, but then lists "PalmOSRuntime_2i_A5.lib" for each. One web hit (for a different dev platform) suggests replacing the Prefix file (currently "PalmOS_Headers_Debug") with a new one that contains: #define UL_ENABLE_SEGMENTS #include "PalmOS_Headers_Debug" No change. I also tried it with no prefix file, after the multi-seg example. Another web hit offers the idea of putting pragma statements throughout the code, to force compilation into different segments, but that seems to defeat the whole CW segmentation scheme. I am out of ideas, and would welcome any advice! -- Natural Resource Ecology Laboratory A225 1231 East Drive, Colorado State University (shipping: 1499 Campus Delivery Fort Collins CO 80523-1499) phone 970-491-5835, fax 970-491-1965 -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
