The SourceForge project page explains generic instructions to install the AllegroPNG libraries in Linux. In Ubuntu it is very easy.
First, install Allegro if you don’t have it. By the time I wrote this entry, Allegro’s latest version was 4.2, so I installed it this way:
sudo apt-get install liballegro4.2-dev liballegro4.2
Then, download the latest version of AllegroPNG from its download section, extract the files and execute these two commands:
chmod +x configure
Now you’ll have to move two of the newly created files to your system’s library directories:
- Move the file libalpng.a to the directory /usr/lib
- Move the file src/alpng.h to the directory /usr/include
And that’s it. Now, every time you compile your allegro file, you should do it with the next command:
g++ main.cpp -o main `allegro-config --libs` -lalpng
Where the argument between the single quotation marks indicates that the file must be compiled using the allegro libraries, and the -lalpng argument indicates that it must use the alpng libraries.