How To Install / Link Allegro 5 With Code::Blocks
How To Install / Link Allegro 5 With Code::Blocks
How To Install / Link Allegro 5 With Code::Blocks
1. Download and install the latest Code::Blocks binary release with GCC compiler
(if you don't prefer some other compiler) from http://www.codeblocks.org
4. Open Code::Blocks and start a new empty project. Complete the wizard.
File->New->Project->Empty project
5. Right-click your project file in the workspace on the left side of the screen, and go to Build Options.
6. Click your project name on the left side of the window,
go to Search Directories->Compiler->Add, find the Allegro include folder
(in my case C:\ALLEGRO\include), click Yes, than OK.
int main()
{
//This is the display on which you draw everyting
ALLEGRO_DISPLAY *display;
return 0;
}
10. Press Ctrl+F9 to build the project, but don't run it yet, it won't work until you copy some .dll files
to your project folder. To do that go to your Allegro folder, and from the bin directory
(in my case C:\ALLEGRO\bin) copy allegro-5.x.x-monolith-mt-debug.dll and allegro-5.x.x-monolith-mt.dll.
Paste allegro-5.x.x-monolith-mt-debug.dll to your project's Debug folder.
Paste allegro-5.x.x-monolith-mt.dll to your project's Release folder.
If everything went OK, you should be able to run your application without any errors (Press F9 in C::B).
You should see a 800x600 white window for 5 seconds. If that's the case, you can start working on your
Allegro projects!