Thanks for the reply Dennis! I really appreciate the help.

I tried to make the code as simple as I could and put it all in one file (like you were mentioning), just to see if I could even get that to work. I still get that same error though - aaargh...

Here's some revamped, simplified code. All the standard Palm functions have been cut short to save on space:

//**************************************************************
#include <PalmOS.h>
#include "resource.h"

// Function(s) in additional section (segment1)

void testing(void) __attribute__((section("segment1")));

// Function(s) in main/default section

void     mainTesting(void);
Boolean  ApplicationEventHandler(EventPtr event);
void     EventLoop();
Err      StartApplication();
void     StopApplication();

Char myTemp[50]; // Some global var

void testing(void) // in "segment1"
{
  StrCopy(myTemp, "in_testing");
}

void mainTesting(void)
{
  StrCopy(myTemp, "in_mainTesting");
  testing();  // <-- produces "undefined reference
              //               to '__text__segment1'"
}

Boolean ApplicationEventHandler(EventPtr event)
{ ... }

void EventLoop()
{ ... }

Err StartApplication()
{ ... }

void StopApplication()
{ ... }

UInt32 PilotMain(UInt16 launchCode, MemPtr cmdPBP, UInt16 launchFlags)
{ ... }

//**********************

The .def file contains:
application { "testApp" blah }
multiple code { segment1 }

I'll keep staring at it... it has to be something simple. It might be an issue in the makefile (which is posted at the beginning of the thread.) I'll just keep looking.

Thanks again for your time and help, Dennis.
Eddie

I think you need to declare your functions with the __attribute__ ((section
("....")) goobers.  From what I can tell from your sample code (and I could
easily be wrong), you used the __attribute__ goober on the extern
declaration but not also on the actual function itself.

I use multiple segments with PRC-Tools but I have just one .c file.  (Bad
form, but it's done that way for historical reasons...)  Consequently I
don't need anything declared extern.

...


As per Lonnon Foster's suggestion, I have the following in my .h file:
------------------
#define CFGVIEW_SECTION         __attribute__ ((section ("cfgview")))
-------------------

I also pretty much followed his other guidelines.

Hope this helps.

Dennis Leas


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus



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

Reply via email to