SDL test program error: No available video device

When I run a SDL (simple direct layer) test program it gives the following
error:
Unable to initialize SDL: No available video device

…this happens when calling SDL_Init:

if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0)

The program is compiled in KDevelop as a SDL program. By the way: there is
no sound in the kdecontrol panel when I click “test”, whereas aplay works no
problem. I am using Gentoo Linux.

How do I configure SDL, assuming that is what is wrong ?

Thanks–
View this message in context: http://www.nabble.com/SDL-test-program-error%3A-No-available-video-device-tp15612515p15612515.html
Sent from the SDL mailing list archive at Nabble.com.

When I run a SDL (simple direct layer) test program it gives the following
error:
Unable to initialize SDL: No available video device

…this happens when calling SDL_Init:

if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0)

The program is compiled in KDevelop as a SDL program. By the way: there is
no sound in the kdecontrol panel when I click “test”, whereas aplay works no
problem. I am using Gentoo Linux.

How do I configure SDL, assuming that is what is wrong ?

Please give the output of ‘emerge -pv libsdl’. Perhaps you haven’t set
some USE-flags.

You can also try different video backends for SDL.

Try:
SDL_VIDEODRIVER=x11 ./yourappAm Freitag, den 22.02.2008, 05:09 -0800 schrieb degras:

Albert Zeyer wrote:

Please give the output of ‘emerge -pv libsdl’. Perhaps you haven’t set
some USE-flags.

OK, here is the output:
tux ~ # emerge -pv libsdl

These are the packages that would be merged, in order:

Calculating dependencies… done!
[ebuild R ] media-libs/libsdl-1.2.11-r2 USE=“alsa -X -aalib -arts
-custom-cflags -dga -directfb -esd -fbcon -ggi -libcaca -nas -noaudio
-nojoystick -novideo -opengl -oss (-svga) -xinerama -xv” 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB–
View this message in context: http://www.nabble.com/SDL-test-program-error%3A-No-available-video-device-tp15612515p15652655.html
Sent from the SDL mailing list archive at Nabble.com.

Albert Zeyer wrote:

Please give the output of ‘emerge -pv libsdl’. Perhaps you haven’t set
some USE-flags.

OK, here is the output:
tux ~ # emerge -pv libsdl

These are the packages that would be merged, in order:

Calculating dependencies… done!
[ebuild R ] media-libs/libsdl-1.2.11-r2 USE=“alsa -X -aalib -arts
-custom-cflags -dga -directfb -esd -fbcon -ggi -libcaca -nas -noaudio
-nojoystick -novideo -opengl -oss (-svga) -xinerama -xv” 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Yes, as you see, a lot of important USE-flags are deactivated. You have
no single video driver activated here.

First read the Gentoo documentation about USE flags, what they are for
and how to enable them.

One easy way to enable them is for example:

emerge ufed	# emerge ufed, a USE-flag-editor
ufed 		# start it

Now activate the following USE-flags: X, opengl, xv

After, emerge libsdl again:

emerge libsdl

Now your problem should be gone away.Am Samstag, den 23.02.2008, 06:30 -0800 schrieb degras:

SDL_AUDIODRIVER=alsa ./yourapp

No sound is produced, no error is shown either.–
View this message in context: http://www.nabble.com/SDL-test-program-error%3A-No-available-video-device-tp15612515p15759346.html
Sent from the SDL mailing list archive at Nabble.com.