<< Pragmas
>> Which functions
First be sure, that the function is really missing: For example floating
point functions are in a special link library and you need a linker option
like `-lm' to include it into your program. Another
possibility would be that you are using a library function and didn't
notice it. This might lead to a missing library base, `IntuitionBase'
for example. In that case
just put something like
struct Library *IntuitionBase;
somewhere in the global part of your program. (Don't forget to call
OpenLibrary() and CloseLibrary! :-)
However, you could as well use a function which really isn't present
in your library at all. If you have, for example, an amiga.lib from
2.0 you would hardly find the locale functions or the pool memory
functions. (7)
Best solution is to get the NDU (see Where do I get the Amiga includes?), but you
probably don't want to wait for it. In that case you have to find
what kind of function you are missing.
- Simple library functions (Examples: `exec/AllocPooled',
`locale/OpenCatalogA') can be called with pragmas. However, you
need informations on the name of the library base and where to put the
arguments. See What are pragmas?.
- Tag functions are mostly just stub functions which call library
functions. If you have, for example, `dos/AllocDosObject' which
expects a constant and a pointer to an array of tags, you have the
varargs version `AllocDosObjectTags' which expects tags on the
stack as well! Just create the following function:
#include <clib/dos_protos.h>
#include <pragmas/dos_pragmas.h> /* Probably wrong name */
void *AllocDosObjectTags(ULONG objtype, Tag tag1, ...)
{ return(AllocDosObject(objtype, (struct TagItem *) &tag1);
}
- Some functions still remain: Amiga.lib has some functions which
are really doing valuable things and not just call a library: The
BOOPSI functions (`DoMethod', `DoSuperMethod') the memory
pool functions (`LibAllocPooled', `LibCreatePool', which are
replacements of 3.0 functions). The only way to replace these is to get
equivalents. The AmigaFAQ archive contains some of them (DoMethod,
DoSuperMethod and HookEntry) in the
`programmer' directory as well as the most common pragma files and some
examples of varargs functions. See The Amiga-FAQ archive.
<< Pragmas
>> Which functions