|
Install and Set up Allegro in Linux. |
Neil Black
Member #7,867
October 2006
|
Basically what the title says. I installed Ubuntu on my computer a while back, but I've just now gotten into programming. I'm compiling from the command line, which is something I've never done before (I learned something today, yay!). So how do I get Allegro installed and set up to work from the command line. And how to I compile Allegro programs from the command line?
|
Thomas Fjellstrom
Member #476
June 2000
|
If you want to skip compiling allegro, just use apt-get or aptitude to install allegro (aptitude install liballegro-dev). Otherwise, you get to download and extract (tar zxf allegro-4.2.2.tar.gz) allegro to some directory. After that you can follow the install directions in doc/build/linux.txt. As for compiling from the command line: debug: release: NOTE: those (`) are backticks, not quotes. -- |
Neil Black
Member #7,867
October 2006
|
Quote: gcc -W -Wall -s -O2 -pipe file.c -o program `allegro-config --libs` I keep getting an "unrecognised option '-02'" error. What are all those different options for? the only one I recognise it '-o'.
|
Thomas Fjellstrom
Member #476
June 2000
|
Quote: I keep getting an "unrecognised option '-02'" error. Its an O (the letter) not a 0 (the number) Quote: What are all those different options for? the only one I recognise it '-o'. -W and -Wall turn on warnings that you NEED to properly program. -- |
Milan Mimica
Member #3,877
September 2003
|
That's O, not 0.
-- |
Neil Black
Member #7,867
October 2006
|
Quote: There's the manual: man gcc. I typed g++ man instead of man g++ for some reason. It's working now. I only have one more question, how do I compile multiple files?
|
Milan Mimica
Member #3,877
September 2003
|
You specify multiple files.
-- |
Evert
Member #794
November 2000
|
Quote: I only have one more question, how do I compile multiple files? By specifying more than one file on the command line. That's not actually the proper way to do it though: the proper way is to compile each file into an object fie and then link the different object file together. That way you don't need to recompile all your source code all the time, just the source that has changed. |
CosmicR
Member #6,889
February 2006
|
I just wrote a tutorial on exactly this how to install allegro in my blog, see my sig!
|
Thomas Fjellstrom
Member #476
June 2000
|
The one file at a time command would look like so: compile: link: Once you get into more than a few source files you may want to think about using makefiles or CMake (or scons for that matter). Makes things a lot easier. -- |
Neil Black
Member #7,867
October 2006
|
Quote: aptitude install liballegro-dev That installs Allegro 4.2, right?
|
Thomas Fjellstrom
Member #476
June 2000
|
Yup. Least till they package 4.4 or 5+ -- |
|