> Populate it with what?  He doesn't have the constant data to populate it
> with.
Yes he does. That's what constant data is.  Plus there is no global memory
in shared libraries

try:
struct LibGlobalData
    {
    UInt32 Var[4][256];
    ...
    }
In your LibOpen routine, lock the global pointer and populate Var.  Since
you know the data that must go into Var, its a simple matter of assigning
the values to the array.  Its an extra step but it beats banging your head
against a wall trying to figure out constants in structures especially when
you don't have access to global memory.


----- Original Message -----
From: "Eric W. Sirko" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 3:57 PM
Subject: Re: globals and shared libs.


> > You could try allocating enough memory in the declaration of your
'global'
> > structure, then use the library initialization to populate the array.
>
> Populate it with what?  He doesn't have the constant data to populate it
> with.
>
> What you want to do, Phillip, is have the constant data compiled into the
> code segment.  Use the following pragma if you're using CodeWarrior:
>
>     #pragma pcrelconstdata on
>
> And be sure to declare your array as const:
>
>     const UInt32 var[4][256] = {...}.
>
>
> Eric W. Sirko
> Softworks Solutions, LLC
>
>




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

Reply via email to