My understanding is that there is no stdlib on the Palm, but Palm creates a
stdlib-like header (by a different name) solely for use
in development, but not in final products. You really should use the Palm view on
memory, which is different than the C view.
Especially since on the Palm memory is so limited that you really DON'T want to use it
as you would in C.
But if you're porting a large C project, just write your own "calloc" and "free"
function and create it using the Palm equivalents:
MemPtrNew
MemPtrFree
MemSet (to clear)
As a side bonus, since you have written your own calloc function, you now have a cool
hook for debugging because you can tally every
alloc done by your code and make sure it was all free'd by the end.
Carl Smith wrote:
> I have an app with numerous calls to calloc. I've included the file #include
> <stdlib.h> which directs to the cstdlib file which in turn holds the
> prototype for calloc. Now if I don't include the
> #include <stdlib.h> I get compile errors as "Function has no prototype" yet
> when I do include the stdlib.h file I get a link error of, "'calloc'
> referenced from 'myfunction' is undefined.
>
> Does any body have any suggestions as to what the problem might be? Could my
> project be hitting the 64k barrier? Plus how does one tell when they are at
> or above the 64k when the project will not compile?
>
> Thanks all
> Carl
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see
>http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/