Tag: allegro
Installing and Using Allegro library
by mage on Sep.01, 2009, under Programming
Hey in this post i would be giving the tutorial to install allegro
library for the open source project.
For people who want to use windows operating system for development :
Compiler suggested – gcc/g++ (GNU c/c++ compiler)
Text editor to be used – Dev C++
Installation :
1. Google “dev c++ download” and follow the links to source-forge to
download the dev-c++ compiler/text-editor.
2. After you have installed Dev-C++, goto tools and click on update
manager.
3. An update manager would show up, click on planetmirror and select
it to devpacks.org.
4. Now click on update, it would download updates.
5. Now click on groups and select Allegro.
6. A list of libraries would show up, select allegro 4.2.2 it is the
latest version.
7. Click on download package and it would install Allegro on Dev C++.
Running your first Allegro Program :
1. Open Dev C++, click on File>New>Project, Select second tab and
select allegro program.
2. A code would pop up, now click on execute and click on compile.
3. If no error shows up, congrats you just compiled your first program
on Allegro.
4. Click on execute and run, and you should see a black screen,
congrats for the first program.
For people who want to use Linux Operating system for development :
Compiler suggested – gcc/g++(GNU c/c++ compiler)
Text editor to be used – You can use any text editor here, recommended
(editra, emacs, vi)
Installation :
1. To install allegro you can either do it from source via tar ball :
http://prdownloads.sourceforge.net/alleg/allegro-4.2.2.tar.gz?download
2. Debian users can run :
|$sudo apt-get install build-essential
|$sudo apt-get install liballegro4.2-dev
This would install allegro library on your system.
Running your first Allegro Program :
1. Open your text editor and type any sample allegro code and save as
‘.c’.
2. Then open terminal and traverse to the path of the program.
|$gcc test.c -o test.out `allegro-config –libs`
now your program would compile.. or give errors accordingly.
3. to execute your program run test.out file.
|$./test.out
Congrats you just wrote your first Allegro program.
Learning Allegro :
Here are the links to the two tutorials that you must go through so as
to get some basic knowledge about allegro library.
http://www.loomsoft.net/resources/alltut/alltut_index.htm
http://www.cppgameprogramming.com/cgi/nav.cgi?page=intro
ANY PROBLEMS REGARDING INSTALLATION AND COMPILATION CAN BE DISCUSSED IN THE FORUM