Src -o Obj/AppName.app Src/LotsOfFiles.o

/usr/local/prc-tools/m68k-palmos/bin/ld: region coderes is full
(Obj/AppName.app section .text)

How do I fix this?

The segment monster claims another victim!


OK, here we go, the most condensed guide to building a multi-segment app using PRC-TOOLS: (don't ask any questions just do what it says, you can study later...)

1. Create a .def file, YourApp.def containing, at the very least:
        application {   "YourApp" "cRId" }
        multiple code {  "segname1"    "segname2"    "segnameN" }

2. In a global header file, put these #define's:
        #define NAME1_SECTION  __attribute__ ((section("segname1")))
        #define NAME2_SECTION  __attribute__ ((section("segname2")))
        #define NAMEN_SECTION  __attribute__ ((section("segnameN")))

3. For every C function you DON'T WANT in the default segment, change the header file declaration (you *are* declaring them all like a good hacker now aren't you?) like so:
extern void Foo( ... );
to-> extern void Foo( ... ) NAME1_SECTION;


4. Ditto for every C++ class method you want in another segment...
                class Foo {
                        void Bar( ... ); becomes void Bar( ... ) NAME2_SECTION;
                };

5. Change your makefile so that...

  (a) your build-prc line looks something like this:
        build-prc YourApp.def <rest of the line>.

(b) add the file YourApp-sections.ld to the list of dependancies required to build the app.

(c) Where did YourApp-sections.ld come from? Add these rules to the makefile as well:
YourApp-sections.o: YourApp-sections.s
$(CC)/$(CXX) -c YourApp-sections.s -o YourApp-sections.o


        YourApp-sections.s YourApp-sections.ld: YourApp.def
                m68k-palmos-multigen YourApp.def

6. GO AND READ EVERYTHING YOU CAN TO UNDERSTAND WHAT YOU HAVE JUST DONE! *8-)

7. THAT'S IT. Safety note: Don't name segments you don't need yet, it causes pain!

If you have any problems then it's time to start reading in-depth about whay you have just done. It's good for the souls but the above should get you out of the hole. If you are still stuck then mail me off-list. I remember my first multi-segment app and it can be confusing, especially on a Friday afternoon!

Sean Charles.


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

Reply via email to