First step: download all the necessary DevPaks from devpak.org. Search and install them in the next order:
Download them and install them through Tools->Package Manager->Install.
Next, you have to check that DevC++ added the necessary command line options for the linker. Go to Project->Project Options->Parameters. In the third list, the linker arguments should include this one:
If it is not there, add it at the very end (including the hyphen).
Next, you have to add two libraries for the linkings. In my computer, they are located inside the lib directory of my DevC++ directory. Press the button “Add library or object” and look for these two files:
Also be sure that all the compilation command has the necesarry arguments to load Allegro, like -lalleg_s. This is my whole linker line, for example:
-lalleg_s -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound -lalpng
Here’s an example of a working piece of code, using an image file called image.png (with transparency) and including two libraries, allegro and alpng:
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0);
img = load_png("image.png", NULL);
set_alpha_blender(); //this is important
draw_trans_sprite(screen, img, 0, 0); //this is important