---
name: "install_allegro"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/install_allegro"
---

# install\_allegro(3alleg)

Initialise the Allegro library.

## NAME

install\_allegro - Initialise the Allegro library.

## SYNOPSIS

**#include \<allegro.h\>**

**int install\_allegro(int system\_id, int \*errno\_ptr, int (\*atexit\_ptr)());**

## DESCRIPTION

Initialises the Allegro library. You must call either this or  allegro\_init() before doing anything other than using the Unicode  routines. If you want to use a text mode other than UTF-8, you can set it with set\_uformat() before you call this. The other functions that can be called before this one will be marked explicitly in the documentation, like set\_config\_file().

The available system ID codes will vary from one platform to another, but you will almost always want to pass SYSTEM\_AUTODETECT. Alternatively, SYSTEM\_NONE installs a stripped down version of Allegro that won't even try to touch your hardware or do anything platform specific: this can be useful for situations where you only want to manipulate memory bitmaps, such as the text mode datafile tools or the Windows GDI interfacing functions.

The \`errno\_ptr' and \`atexit\_ptr' parameters should point to the errno variable and atexit function from your libc: these are required because when Allegro is linked as a DLL, it doesn't have direct access to your local libc data. \`atexit\_ptr' may be NULL, in which case it is your responsibility to call allegro\_exit() manually. Example:

```
   install_allegro(SYSTEM_AUTODETECT, &errno, atexit);
```

## RETURN VALUE

This function returns zero on success and non-zero on failure (e.g. no system driver could be used). Note: in previous versions of Allegro this function would abort on error.

## SEE ALSO

[**allegro\_init**(3alleg)](/allegro_init/3alleg.md), [**allegro\_exit**(3alleg)](/allegro_exit/3alleg.md), [**set\_uformat**(3alleg)](/set_uformat/3alleg.md), [**set\_config\_file**(3alleg)](/set_config_file/3alleg.md)
