OSLib – Open source API for RISC OS development

How to use OSLib

Include OSLib headers

For C/C++ programs, you include the OSLib/OSLibSupport headers like as in following example:

#include <oslib/draw.h>

For assembler programs, this depends on the type of assembler:

Acorn/Norcroft C compiler

GCCSDK GCC compiler

Using GCCSDK GCC on RISC OS: When you are using GCCSDK GCC on a non-RISC OS platform (as cross-compiler), you can use the same syntax as on RISC OS with the following two exceptions: When using GCCSDK GCC 3.4.x or Acorn/Norcroft compiler or AsAsm with "-aof" option, you need to use AOF based OSLib binaries.

When using GCCSDK GCC 4.x including AsAsm with "-elf" or without "-aof" option (as the "-elf" option is default), you need to use ELF based OSLib binaries. This is only possible from OSLib 7.00 onwards.

Furthermore, when you are using the ELF OSLib binaries, there are three different set of binaries depending on when you want to use the SharedCLibrary for application usage, SharedCLibrary for module usage or UnixLib usage:

Site Contents