mvandemar
August 26th, 2011, 08:08 PM
I am teaching myself game programming, and I wanted to try my hand at c++. I already installed build-essential and was able to play around and compile projects using gcc. I was trying to install allegro 5.0.4 via the downloaded source from here (the repositories only have liballegro4.2):
http://alleg.sourceforge.net/download.html
Just so you have all of the info, I unzipped it onto my desktop, and following the instructions in the readme I created a new directory named Build, cd'd into that directory, and ran the following commands:
$ cmake ~/Desktop/allegro-5.0.4/
$ make
$ make install
It failed the first time, so then I ran sudo make install instead and it seemed to work. I have attached a tarred up text file of all of the output from that.
However, when I tried compiling a sample program I get the following errors:
1) If I use:
#include <allegro.h>
I get "ascreen.cpp:1:21: fatal error: allegro.h: No such file or directory". I tried adding /usr/local/include/allegro5 to my path, but that did not work either. However, if I use the full path in the include statement that error goes away:
#include </usr/local/include/allegro5/allegro.h>
2) At this point when I try and compile I am getting scope errors tho:
ascreen.cpp: In function ‘int main(int, char**)’:
ascreen.cpp:4:15: error: ‘allegro_init’ was not declared in this scope
ascreen.cpp:5:19: error: ‘install_keyboard’ was not declared in this scope
ascreen.cpp:6:15: error: ‘GFX_AUTODETECT’ was not declared in this scope
ascreen.cpp:6:42: error: ‘set_gfx_mode’ was not declared in this scope
ascreen.cpp:7:10: error: ‘readkey’ was not declared in this scope
ascreen.cpp: At global scope:
ascreen.cpp:10:13: error: expected constructor, destructor, or type conversion at end of input
From what I read that is solved by adding `allegro-config --libs` to the compile statement:
gcc ascreen.cpp `allegro-config --libs`
which produces this error (followed by the same scope errors):
The program 'allegro-config' is currently not installed. You can install it by typing:
sudo apt-get install liballegro4.2-dev
Which is the version of allegro that is in the repositories, so obviously I did something wrong when I tried installing from source. I say all of that to ask this... while I was researching how to fix this, I came across a suggestion that many of the linking and path issues can be solved if you install via svn using these instructions:
http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/Linux/Debian
and in those instructions the only thing I see differently is using ccmake instead of cmake, and the following parameter used when calling it:
ccmake -DCMAKE_INSTALL_PREFIX=/usr ..
So I would like to try and reinstall it starting with that command instead, and if that fails just installing 4.2 from the repositories. My problem is, how do I uninstall what I have already done? I would like to start with a clean slate, in order to avoid any conflicts, but I don't know how to to that. I do know that nothing is showing in synaptic as installed, and the following did not work:
$ whereis liballegro
liballegro: /usr/local/lib/liballegro.so
$ sudo apt-get remove liballegro
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package liballegro
Any help would be appreciated, thanks. :)
-Michael
http://alleg.sourceforge.net/download.html
Just so you have all of the info, I unzipped it onto my desktop, and following the instructions in the readme I created a new directory named Build, cd'd into that directory, and ran the following commands:
$ cmake ~/Desktop/allegro-5.0.4/
$ make
$ make install
It failed the first time, so then I ran sudo make install instead and it seemed to work. I have attached a tarred up text file of all of the output from that.
However, when I tried compiling a sample program I get the following errors:
1) If I use:
#include <allegro.h>
I get "ascreen.cpp:1:21: fatal error: allegro.h: No such file or directory". I tried adding /usr/local/include/allegro5 to my path, but that did not work either. However, if I use the full path in the include statement that error goes away:
#include </usr/local/include/allegro5/allegro.h>
2) At this point when I try and compile I am getting scope errors tho:
ascreen.cpp: In function ‘int main(int, char**)’:
ascreen.cpp:4:15: error: ‘allegro_init’ was not declared in this scope
ascreen.cpp:5:19: error: ‘install_keyboard’ was not declared in this scope
ascreen.cpp:6:15: error: ‘GFX_AUTODETECT’ was not declared in this scope
ascreen.cpp:6:42: error: ‘set_gfx_mode’ was not declared in this scope
ascreen.cpp:7:10: error: ‘readkey’ was not declared in this scope
ascreen.cpp: At global scope:
ascreen.cpp:10:13: error: expected constructor, destructor, or type conversion at end of input
From what I read that is solved by adding `allegro-config --libs` to the compile statement:
gcc ascreen.cpp `allegro-config --libs`
which produces this error (followed by the same scope errors):
The program 'allegro-config' is currently not installed. You can install it by typing:
sudo apt-get install liballegro4.2-dev
Which is the version of allegro that is in the repositories, so obviously I did something wrong when I tried installing from source. I say all of that to ask this... while I was researching how to fix this, I came across a suggestion that many of the linking and path issues can be solved if you install via svn using these instructions:
http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/Linux/Debian
and in those instructions the only thing I see differently is using ccmake instead of cmake, and the following parameter used when calling it:
ccmake -DCMAKE_INSTALL_PREFIX=/usr ..
So I would like to try and reinstall it starting with that command instead, and if that fails just installing 4.2 from the repositories. My problem is, how do I uninstall what I have already done? I would like to start with a clean slate, in order to avoid any conflicts, but I don't know how to to that. I do know that nothing is showing in synaptic as installed, and the following did not work:
$ whereis liballegro
liballegro: /usr/local/lib/liballegro.so
$ sudo apt-get remove liballegro
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package liballegro
Any help would be appreciated, thanks. :)
-Michael