At 10:10 AM 6/1/2004, you wrote:
I'm currently working on a fairly large C++ application in CW that uses the
POL library. Our application was working fine in the emulator; however when
testing on a real device, we got a fatal exception when installing.

I reinstalled the app in the emulator and did a soft reset and verified that
the application throws a fatal exception when any "non-standard" launch code
is fired. I rechecked that my segment 1 contains all the necessary
components (i.e., runtime library, CApp, all classes called from PilotMain,
etc.). The debugger showed a stack trace that was random in that sometimes
it said the crash occurred in ClassA::methodA while other times it said
ClassA::methodB or ClassB::methodA.

This sounds like the POL support code that's in POL Lib 1.lib isn't in your first segment. That could cause a crash -- it's likely that your code doesn't work on the emulator either, you're just not seeing the crash because you only load it to the emulator using the CW debugger.


Based on these findings, I suspect my PRC file is corrupt (more specifically
my Segment 1 is greater than 64 KB even though the link map says otherwise).

The link map is correct.

I tried to take more control over linking by disabling the option 'Merge
compiler glue into Segment 1' in the 68k Linker panel. Of course, I received
many link errors, but what concerns me now is that it looks like all the
glue code is placed in a virtual segment right after the ones defined in CW.

There are no virtual segments. If the merge option is off, CW will just include any compiler glue in the segment in which it is found.


3. After disabling the 'Merge compiler glue into Segment 1' option, how can
I force which segment this glue code gets placed into?

There isn't much glue code you have to worry about -- this really is just inline functions that are generated out-of-line and template code that's generated for you.



-- Ben Combee, DTS technical lead, PalmSource, Inc. Read "Combee on Palm OS" at http://palmos.combee.net/



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

Reply via email to