Newbie needs help

I am porting a DOS graphics application to Linux. I’d like to try
SDL but have run into a snag. I’ve successfully downloaded it,
installed it and compiled one of the test programs, namely
testkeys.c. But when I run it, SDL_Init returns me this message:
Couldn’t initialize SDL: No available video device. The Linux
SDL FAQ says that in that situation I should set the DISPLAY
environment variable to DISPLAY=:0. I tried this. No help
there. The FAQ also tells me to try xhost +localhost. xhost
just returns the message: Can’t open display :0 (or whatever I’ve
set the DISPLAY environment variable to. I’ve tried :0, 0, x11,
fbcon, etc. Just shooting in the dark here.)

The General SDL FAQ tells me to set the environment variable
SDL_VIDEODRIVER=x, where x is x11 or fbcon or svgalib or ggi or
aalib. I have tried these. No luck. I have svgalib installed
and I assume that I have x11, since I can run KDE and GNOME
without problems. What am I not understanding?

Please explain. I am new to Linux, so please do not assume that
I know anything. Oh, and by the way, when I set environment
variables, they stay set only during the current login session.
Next time I log in they are gone from the list returned by the
set command.

Bob–



Ok, here are some problems you could be having:

Environment setting depends on the shell you’re in.
grep /etc/passwd to find the shell, it’s the last field

tcsh/csh
setenv DISPLAY localhost:0

sh/bash/ksh
DISPLAY=localhost:0; export DISPLAY

To make them permanent, add these commands to your .[t]cshrc
or .profile, respectively.

Did you log in directly, or do an su? That can screw this up,
too.

Is X running?

(Thu, Sep 27, 2001 at 10:22:45PM -0400)
Bob Brill (bobbrill at migate.net) said:> I am porting a DOS graphics application to Linux. I’d like to try

SDL but have run into a snag. I’ve successfully downloaded it,
installed it and compiled one of the test programs, namely
testkeys.c. But when I run it, SDL_Init returns me this message:
Couldn’t initialize SDL: No available video device. The Linux
SDL FAQ says that in that situation I should set the DISPLAY
environment variable to DISPLAY=:0. I tried this. No help
there. The FAQ also tells me to try xhost +localhost. xhost
just returns the message: Can’t open display :0 (or whatever I’ve
set the DISPLAY environment variable to. I’ve tried :0, 0, x11,
fbcon, etc. Just shooting in the dark here.)

The General SDL FAQ tells me to set the environment variable
SDL_VIDEODRIVER=x, where x is x11 or fbcon or svgalib or ggi or
aalib. I have tried these. No luck. I have svgalib installed
and I assume that I have x11, since I can run KDE and GNOME
without problems. What am I not understanding?

Please explain. I am new to Linux, so please do not assume that
I know anything. Oh, and by the way, when I set environment
variables, they stay set only during the current login session.
Next time I log in they are gone from the list returned by the
set command.

Bob




SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Marc MacIntyre
@Marc_MacIntyre

Hypocrite: The man who murdered his parents, and then pleaded
for mercy on the grounds that he was an orphan.
-Abraham Lincoln
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010927/bb264a91/attachment-0007.pgp>

Also, one other thing, did you install SDL from source, or did you install a
binary package (such as RPM or DEB)?

(these other questions are very good as well…)On Thursday 27 September 2001 8:34, Marc MacIntyre wrote:

Ok, here are some problems you could be having:

Environment setting depends on the shell you’re in.
grep /etc/passwd to find the shell, it’s the last field

tcsh/csh
setenv DISPLAY localhost:0

sh/bash/ksh
DISPLAY=localhost:0; export DISPLAY

To make them permanent, add these commands to your .[t]cshrc
or .profile, respectively.

Did you log in directly, or do an su? That can screw this up,
too.

Is X running?

(Thu, Sep 27, 2001 at 10:22:45PM -0400)

Bob Brill (bobbrill at migate.net) said:

I am porting a DOS graphics application to Linux. I’d like to try
SDL but have run into a snag. I’ve successfully downloaded it,
installed it and compiled one of the test programs, namely
testkeys.c. But when I run it, SDL_Init returns me this message:
Couldn’t initialize SDL: No available video device. The Linux
SDL FAQ says that in that situation I should set the DISPLAY
environment variable to DISPLAY=:0. I tried this. No help
there. The FAQ also tells me to try xhost +localhost. xhost
just returns the message: Can’t open display :0 (or whatever I’ve
set the DISPLAY environment variable to. I’ve tried :0, 0, x11,
fbcon, etc. Just shooting in the dark here.)

The General SDL FAQ tells me to set the environment variable
SDL_VIDEODRIVER=x, where x is x11 or fbcon or svgalib or ggi or
aalib. I have tried these. No luck. I have svgalib installed
and I assume that I have x11, since I can run KDE and GNOME
without problems. What am I not understanding?

Please explain. I am new to Linux, so please do not assume that
I know anything. Oh, and by the way, when I set environment
variables, they stay set only during the current login session.
Next time I log in they are gone from the list returned by the
set command.


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Tux4Kids: < http://www.geekcomix.com/tux4kids/ >

Just to be certain, you ARE running this from within X, aren’t you?

-JohnOn Thursday 27 September 2001 10:22 pm, you wrote:

I should set the DISPLAY
environment variable to DISPLAY=:0. ?I tried this. ?No help
there. ?The FAQ also tells me to try xhost +localhost. ?xhost
just returns the message: Can’t open display :0 (or whatever I’ve
set the DISPLAY environment variable to. ?I’ve tried :0, 0, x11,
fbcon, etc. ?Just shooting in the dark here.)


John R. Hall
Author, Programming Linux Games
CS Student/Geek, Georgia Tech

I have svgalib installed
Take in advance this, on SVGALIB, you need to be root to be able to run
the application (that’s because the SVGALIB need root privilegies to
access
the video card), or set the setuid flag on the application owned by root.
To do this last thing so you can run the application without being root do
this:

chown root.root
chmod u+s

Greettings.
Ernesto