I'm having some trouble running allegro programs under linux. I get the error:
Fatal error: unable to activate the Allegro system
Unable to find a usable VT
I created an allegro.cfg file and added:
[system]
system = XWIN
The only effect this had was to shorten the error to:
Fatal error: unable to activate the Allegro system
The crash seems to occur right when I call allegro_init(); This confuses me, because "Unable to find a usable VT" seems to imply it's trying to initialize graphics? Or what? Here's my program:
#include "allegro.h" int main(int argc, char* argv[]) { allegro_init(); return 0; }//main END_OF_MAIN()
On initialisation, Allegro will try to connect to an X server. If it can't find one, it will give up and try to use some different system driver instead (such as the Linux console).
This must be what is happening, because I originally got:
Unable to open /dev/console: Permission denied
...until I ran chmod a+rw /dev/console
And the FINAL CLUE is:
"Right. Install the X11 development libraries, then reconfigure and recompile Allegro."
I've been searching for them here, any idea what their file name(s) might be?
I'm running Debian Linux Sarge, with kernel 2.4.27 Any help or ideas would be very appreciated!
I would expect to find x11-devel, but that's not listed. Maybe Debian uses different application names.
Doesn't Debian come with a graphical installer where you can just tell it to get some package? Or is Debian the one where you could do `apt-get x11-devel' from the commandline and it'd work?
x11-dev? xfree86-dev? I think debian uses "dev" rather than "devel" in any case.
Yes, debian uses apt, and that would work.
After more searching, I found this:
http://packages.debian.org/testing/libs/liballegro4.1
Wow! It had never occurred to me that Debian might actually have an Allegro package. I mean, an OS with built-in Allegro support.8-)
I'm going to give it a shot with apt-get as soon as I get home.
Hehe... actually, all (major) Linux distributions ship with Allegro.
I had no idea Allegro was so widely accepted!
Anyways, after more confusion, I discovered that these are the actual packages that should be installed:
http://packages.debian.org/testing/libdevel/liballegro-dev
http://packages.debian.org/testing/doc/liballegro-doc
http://packages.debian.org/testing/utils/allegro-examples
And this is the command that will automagically retrieve and install them (as root):
apt-get install liballegro-dev liballegro-doc allegro-examples
I wonder if it would be worthwhile to add this information to the file page or the unix build doc? Might save Debian users a lot of hassle.
To compile Allegro for X11 from sources, you just need this:
apt-get install libx11-dev
And to use hardware cursor support, this:
apt-get install libxcursor-dev
And so on for other optional drivers, like sound drivers. If someone creates a list of devel packages needed for various distributions, we could add it to docs/build/unix.txt. Maybe I get around to doing it for Debian..
If someone creates a list of devel packages needed for various distributions
I'm a newcomer to Debian, but I'm not sure if that's necessary? All Debian packages list any other packages they require to work properly. For example, liballegro-dev requires liballegro4.1, libx11-dev, libxext-dev, libxpm-dev, xlibs-static-dev and xlibs-static-pic.
You can get similar info for the other packages by clicking on the above links, but I believe that Debian handles all of this for you. When I did a 'man apt-get', I got:
install is followed by one or more packages desired for installation. Each package is a package name, not a fully qualified filename (for instance, in a Debian GNU/Linux system, libc6 would be the argument provided, not libc6_1.9.6-2.deb) All packages required by the package(s) specified for installation will also be retrieved and installed.
I have yet to try this out though, because I already had all the required libs. But if my understanding is right, the only line a Debian user should ever have to run is:
apt-get install liballegro-dev liballegro-doc allegro-examples
[EDIT] Huzzah! Here's a log of an allegro install on my server machine:
| 1 | TheBox:~# apt-get update |
| 2 | Get:1 http://security.debian.org testing/updates/main Packages [2541B] |
| 3 | Get:2 http://security.debian.org testing/updates/main Release [111B] |
| 4 | Get:3 ftp://mirror.cpsc.ucalgary.ca testing/main Packages [3145kB] |
| 5 | Get:4 ftp://mirror.cpsc.ucalgary.ca testing/main Release [81B] |
| 6 | Get:5 ftp://mirror.cpsc.ucalgary.ca testing/main Sources [1250kB] |
| 7 | Get:6 ftp://mirror.cpsc.ucalgary.ca testing/main Release [83B] |
| 8 | Fetched 4398kB in 15s (275kB/s) |
| 9 | Reading Package Lists... Done |
| 10 | Building Dependency Tree... Done |
| 11 | TheBox:~# apt-get install liballegro-dev liballegro-doc allegro-examples |
| 12 | Reading Package Lists... Done |
| 13 | Building Dependency Tree... Done |
| 14 | The following extra packages will be installed: |
| 15 | autoconf debconf debconf-i18n defoma dialog fontconfig liballegro4.1 libasound2 libc6 libc6-dev libdb1-compat libdb4.2 |
| 16 | libexpat1 libfontconfig1 libfreetype6 libgdbm3 libice6 liblocale-gettext-perl libncursesw5 libnewt0.51 libpopt0 libsm6 |
| 17 | libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libx11-6 libx11-dev libxext-dev libxext6 libxft1 |
| 18 | libxi-dev libxi6 libxmu6 libxmuu1 libxp6 libxpm-dev libxpm4 libxrandr2 libxrender1 libxt6 libxtrap6 libxtst6 libxv-dev |
| 19 | libxv1 linux-kernel-headers locales perl perl-base perl-modules slang1a-utf8 ttf-bitstream-vera ucf whiptail x-dev |
| 20 | xfree86-common xlibs xlibs-data xlibs-static-dev xlibs-static-pic zlib1g zlib1g-dev |
| 21 | The following packages will be REMOVED: |
| 22 | autoconf2.13 libnss-db |
| 23 | The following NEW packages will be installed: |
| 24 | allegro-examples debconf-i18n defoma dialog fontconfig liballegro-dev liballegro-doc liballegro4.1 libasound2 |
| 25 | libdb1-compat libdb4.2 libexpat1 libfontconfig1 libgdbm3 libice6 liblocale-gettext-perl libncursesw5 libnewt0.51 libsm6 |
| 26 | libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libx11-6 libx11-dev libxext-dev libxext6 libxft1 |
| 27 | libxi-dev libxi6 libxmu6 libxmuu1 libxp6 libxpm-dev libxpm4 libxrandr2 libxrender1 libxt6 libxtrap6 libxtst6 libxv-dev |
| 28 | libxv1 linux-kernel-headers slang1a-utf8 ttf-bitstream-vera ucf x-dev xlibs-data xlibs-static-dev xlibs-static-pic |
| 29 | zlib1g-dev |
| 30 | 14 packages upgraded, 50 newly installed, 2 to remove and 169 not upgraded. |
| 31 | Need to get 34.9MB of archives. After unpacking 62.8MB will be used. |
| 32 | Do you want to continue? [Y/n] Y |
| 33 | Get:1 ftp://mirror.cpsc.ucalgary.ca testing/main libdb1-compat 2.1.3-7 [30.8kB] |
| 34 | Get:2 ftp://mirror.cpsc.ucalgary.ca testing/main libc6-dev 2.3.2.ds1-18 [2531kB] |
| 35 | Get:3 ftp://mirror.cpsc.ucalgary.ca testing/main linux-kernel-headers 2.5.999-test7-bk-16 [1377kB] |
| 36 | Get:4 ftp://mirror.cpsc.ucalgary.ca testing/main locales 2.3.2.ds1-18 [3981kB] |
| 37 | Get:5 ftp://mirror.cpsc.ucalgary.ca testing/main libc6 2.3.2.ds1-18 [4921kB] |
| 38 | Get:6 ftp://mirror.cpsc.ucalgary.ca testing/main autoconf 2.59-8 [766kB] |
| 39 | Get:7 ftp://mirror.cpsc.ucalgary.ca testing/main perl-modules 5.8.4-3 [2182kB] |
| 40 | Get:8 ftp://mirror.cpsc.ucalgary.ca testing/main libdb4.2 4.2.52-17 [388kB] |
| 41 | Get:9 ftp://mirror.cpsc.ucalgary.ca testing/main libgdbm3 1.8.3-2 [21.3kB] |
| 42 | Get:10 ftp://mirror.cpsc.ucalgary.ca testing/main perl 5.8.4-3 [3238kB] |
| 43 | Get:11 ftp://mirror.cpsc.ucalgary.ca testing/main perl-base 5.8.4-3 [747kB] |
| 44 | Get:12 ftp://mirror.cpsc.ucalgary.ca testing/main liblocale-gettext-perl 1.01-17 [16.8kB] |
| 45 | Get:13 ftp://mirror.cpsc.ucalgary.ca testing/main libtext-iconv-perl 1.2-3 [12.2kB] |
| 46 | Get:14 ftp://mirror.cpsc.ucalgary.ca testing/main libtext-charwidth-perl 0.04-1 [11.0kB] |
| 47 | Get:15 ftp://mirror.cpsc.ucalgary.ca testing/main libtext-wrapi18n-perl 0.06-1 [8442B] |
| 48 | Get:16 ftp://mirror.cpsc.ucalgary.ca testing/main debconf-i18n 1.4.30.8 [84.6kB] |
| 49 | Get:17 ftp://mirror.cpsc.ucalgary.ca testing/main slang1a-utf8 1.4.9dbs-8 [297kB] |
| 50 | Get:18 ftp://mirror.cpsc.ucalgary.ca testing/main libnewt0.51 0.51.6-18 [57.0kB] |
| 51 | Get:19 ftp://mirror.cpsc.ucalgary.ca testing/main libpopt0 1.7-5 [30.2kB] |
| 52 | Get:20 ftp://mirror.cpsc.ucalgary.ca testing/main whiptail 0.51.6-18 [31.9kB] |
| 53 | Get:21 ftp://mirror.cpsc.ucalgary.ca testing/main debconf 1.4.30.8 [99.7kB] |
| 54 | Get:22 ftp://mirror.cpsc.ucalgary.ca testing/main zlib1g 1:1.2.2-1 [62.8kB] |
| 55 | Get:23 ftp://mirror.cpsc.ucalgary.ca testing/main libncursesw5 5.4-4 [287kB] |
| 56 | Get:24 ftp://mirror.cpsc.ucalgary.ca testing/main dialog 1.0-20040920-1 [178kB] |
| 57 | Get:25 ftp://mirror.cpsc.ucalgary.ca testing/main libasound2 1.0.6-3 [301kB] |
| 58 | Get:26 ftp://mirror.cpsc.ucalgary.ca testing/main xlibs 4.3.0.dfsg.1-8 [403kB] |
| 59 | Get:27 ftp://mirror.cpsc.ucalgary.ca testing/main libice6 4.3.0.dfsg.1-8 [189kB] |
| 60 | Get:28 ftp://mirror.cpsc.ucalgary.ca testing/main libsm6 4.3.0.dfsg.1-8 [167kB] |
| 61 | Get:29 ftp://mirror.cpsc.ucalgary.ca testing/main libxext6 4.3.0.dfsg.1-8 [174kB] |
| 62 | Get:30 ftp://mirror.cpsc.ucalgary.ca testing/main libexpat1 1.95.8-1 [59.5kB] |
| 63 | Get:31 ftp://mirror.cpsc.ucalgary.ca testing/main libfreetype6 2.1.7-2.2 [363kB] |
| 64 | Get:32 ftp://mirror.cpsc.ucalgary.ca testing/main defoma 0.11.8-0.1 [77.9kB] |
| 65 | Get:33 ftp://mirror.cpsc.ucalgary.ca testing/main ucf 1.10 [34.9kB] |
| 66 | Get:34 ftp://mirror.cpsc.ucalgary.ca testing/main ttf-bitstream-vera 1.10-3 [354kB] |
| 67 | Get:35 ftp://mirror.cpsc.ucalgary.ca testing/main fontconfig 2.2.3-1 [59.9kB] |
| 68 | Get:36 ftp://mirror.cpsc.ucalgary.ca testing/main libfontconfig1 2.2.3-1 [89.3kB] |
| 69 | Get:37 ftp://mirror.cpsc.ucalgary.ca testing/main libxrender1 0.8.3-7 [25.1kB] |
| 70 | Get:38 ftp://mirror.cpsc.ucalgary.ca testing/main libxft1 4.3.0.dfsg.1-8 [176kB] |
| 71 | Get:39 ftp://mirror.cpsc.ucalgary.ca testing/main libxi6 4.3.0.dfsg.1-8 [165kB] |
| 72 | Get:40 ftp://mirror.cpsc.ucalgary.ca testing/main libxt6 4.3.0.dfsg.1-8 [312kB] |
| 73 | Get:41 ftp://mirror.cpsc.ucalgary.ca testing/main libxmu6 4.3.0.dfsg.1-8 [195kB] |
| 74 | Get:42 ftp://mirror.cpsc.ucalgary.ca testing/main libxmuu1 4.3.0.dfsg.1-8 [157kB] |
| 75 | Get:43 ftp://mirror.cpsc.ucalgary.ca testing/main libxp6 4.3.0.dfsg.1-8 [164kB] |
| 76 | Get:44 ftp://mirror.cpsc.ucalgary.ca testing/main libxpm4 4.3.0.dfsg.1-8 [180kB] |
| 77 | Get:45 ftp://mirror.cpsc.ucalgary.ca testing/main libxrandr2 4.3.0.dfsg.1-8 [157kB] |
| 78 | Get:46 ftp://mirror.cpsc.ucalgary.ca testing/main libxtrap6 4.3.0.dfsg.1-8 [166kB] |
| 79 | Get:47 ftp://mirror.cpsc.ucalgary.ca testing/main libxtst6 4.3.0.dfsg.1-8 [160kB] |
| 80 | Get:48 ftp://mirror.cpsc.ucalgary.ca testing/main xlibs-data 4.3.0.dfsg.1-8 [891kB] |
| 81 | Get:49 ftp://mirror.cpsc.ucalgary.ca testing/main xfree86-common 4.3.0.dfsg.1-8 [775kB] |
| 82 | Get:50 ftp://mirror.cpsc.ucalgary.ca testing/main libx11-6 4.3.0.dfsg.1-8 [702kB] |
| 83 | Get:51 ftp://mirror.cpsc.ucalgary.ca testing/main liballegro4.1 2:4.1.15-5 [447kB] |
| 84 | Get:52 ftp://mirror.cpsc.ucalgary.ca testing/main allegro-examples 2:4.1.15-5 [333kB] |
| 85 | Get:53 ftp://mirror.cpsc.ucalgary.ca testing/main x-dev 4.3.0.dfsg.1-8 [202kB] |
| 86 | Get:54 ftp://mirror.cpsc.ucalgary.ca testing/main libxext-dev 4.3.0.dfsg.1-8 [232kB] |
| 87 | Get:55 ftp://mirror.cpsc.ucalgary.ca testing/main libxi-dev 4.3.0.dfsg.1-8 [217kB] |
| 88 | Get:56 ftp://mirror.cpsc.ucalgary.ca testing/main libxv1 4.3.0.dfsg.1-8 [158kB] |
| 89 | Get:57 ftp://mirror.cpsc.ucalgary.ca testing/main libxv-dev 4.3.0.dfsg.1-8 [176kB] |
| 90 | Get:58 ftp://mirror.cpsc.ucalgary.ca testing/main zlib1g-dev 1:1.2.2-1 [488kB] |
| 91 | Get:59 ftp://mirror.cpsc.ucalgary.ca testing/main xlibs-static-dev 4.3.0.dfsg.1-8 [840kB] |
| 92 | Get:60 ftp://mirror.cpsc.ucalgary.ca testing/main libx11-dev 4.3.0.dfsg.1-8 [1344kB] |
| 93 | Get:61 ftp://mirror.cpsc.ucalgary.ca testing/main libxpm-dev 4.3.0.dfsg.1-8 [178kB] |
| 94 | Get:62 ftp://mirror.cpsc.ucalgary.ca testing/main xlibs-static-pic 4.3.0.dfsg.1-8 [370kB] |
| 95 | Get:63 ftp://mirror.cpsc.ucalgary.ca testing/main liballegro-dev 2:4.1.15-5 [808kB] |
| 96 | Get:64 ftp://mirror.cpsc.ucalgary.ca testing/main liballegro-doc 2:4.1.15-5 [1241kB] |
| 97 | Fetched 34.9MB in 2m35s (224kB/s) |
| 98 | Preconfiguring packages ... |
| 99 | Selecting previously deselected package libdb1-compat. |
| 100 | (Reading database ... 16195 files and directories currently installed.) |
| 101 | Unpacking libdb1-compat (from .../libdb1-compat_2.1.3-7_i386.deb) ... |
| 102 | Replacing files in old package libc6 ... |
| 103 | (Reading database ... 16198 files and directories currently installed.) |
| 104 | Removing libnss-db ... |
| 105 | (Reading database ... 16185 files and directories currently installed.) |
| 106 | Preparing to replace libc6-dev 2.2.5-11.5 (using .../libc6-dev_2.3.2.ds1-18_i386.deb) ... |
| 107 | Unpacking replacement libc6-dev ... |
| 108 | Selecting previously deselected package linux-kernel-headers. |
| 109 | Unpacking linux-kernel-headers (from .../linux-kernel-headers_2.5.999-test7-bk-16_i386.deb) ... |
| 110 | Preparing to replace locales 2.2.5-11.5 (using .../locales_2.3.2.ds1-18_all.deb) ... |
| 111 | Unpacking replacement locales ... |
| 112 | Preparing to replace libc6 2.2.5-11.5 (using .../libc6_2.3.2.ds1-18_i386.deb) ... |
| 113 | |
| 114 | Name Service Switch has changed in the C Library: pre-installation question. |
| 115 | |
| 116 | Running programs may not be able to do NSS lookups until they are restarted. |
| 117 | Some services can not accept all authentication after extracting glibc |
| 118 | package into your system. This script automatically restarts some packages |
| 119 | for example ssh or telnetd, but other packages for example xdm |
| 120 | cannot restart because if it restarts automatically, then your X11 session |
| 121 | is disconnected. So you have to logout and stop xdm; you have to |
| 122 | restart all such services after upgrading glibc with your hands. |
| 123 | Known packages that are needed to stop before installing glibc 2.3: |
| 124 | xdm kdm gdm postgresql xscreensaver |
| 125 | |
| 126 | This script does not detect services which need to stop. |
| 127 | If you want to stop upgrade for the present, please answer the below |
| 128 | question as No. |
| 129 | |
| 130 | Do you want to upgrade glibc? [Y/n] Y |
| 131 | |
| 132 | Unpacking replacement libc6 ... |
| 133 | Setting up libc6 (2.3.2.ds1-18) ... |
| 134 | Checking for services that may need to be restarted...done. |
| 135 | |
| 136 | Name Service Switch has changed in the C Library: post-installation question. |
| 137 | Running programs may not be able to do NSS lookups until they are |
| 138 | restarted (for services such as ssh, this can affect your ability to |
| 139 | login). |
| 140 | Note: restarting sshd/telnetd should not affect any existing connections. |
| 141 | |
| 142 | The services detected are: inetd cron ssh exim |
| 143 | |
| 144 | If other services begin to fail mysteriously after this upgrade, |
| 145 | it may be necessary to restart them too. We strongly recommend |
| 146 | you to reboot your machine to avoid the NSS related trouble. |
| 147 | |
| 148 | Do you wish to Restart Services? [Y/n] |
Yes, of course, as long as Sam Hovecar (or whatever was the maintainers name) fills in all the dependencies
But he forgot libxcursor for 4.1.16 I believe.