Adding a Library in Other IDEs

The procedure of adding a library to a project in an IDE always has the same outline, regardless of the operating system or the IDE used. The location of header files needs to be specified, and the library object files need to be provided.

If you are using an IDE other than Visual Studio, you will need to specify the location of the (Allegro library) header files somewhere in the project settings. The option is commonly called 'Include Paths', or 'Search Directories', or 'Include Directories'.

Next, you will need to provide the path and name of the library object file. This option is commonly named 'Libraries' or 'Link Libraries'. On Microsoft Windows OSes, you should be linking to a library file named 'allegro-4.4.2-md.lib'.

On Microsoft Windows OSes, the header files and library object files will be located wherever you have unpacked them. The header files have the .h extension, and the library object files have the .lib extension.

On a GNU/Linux-based OS, after installing Allegro 4 from a repository, to find out the location of header files, use the command:

echo `allegro-config --cflags`

It prints out compiler options needed to use the Allegro library. Among them will be a path to the directory holding Allegro library header files. This directory will be specified after the –I compiler option, which is used to specify the location of header files.

To find out the names of library object files and other linker options, use the command:

echo `allegro-config --libs`