安装sdl

安装sdl一切正常,但是就行编译后的程序却出现了No available audio device的错误.查看sdl 的FAQ也没有找到解决方法.

goole也没有找到直接的答案.stackoverflow上也有关于这个问题的回答,但我这试了都没有用.最后在http://forums.libsdl.org/viewtopic.php?t=7609&sid=a1c1c35ffaeddba9cc0bf7854ddce6a0p看到了这样一段话

If you built your own SDL, you probably didn't have development headers
for PulseAudio (or ALSA), so it's trying to use /dev/dsp, which doesn't
exist on many modern Linux systems (hence, SDL_Init(SDL_INIT_AUDIO)
succeeds, but no devices are found when you try to open one). "apt-get
install libasound2-dev libpulse-dev" and rebuild SDL...let the configure
script find the new headers so it includes PulseAudio and ALSA support.

发现需要PulseAudio或ALSA的支持.安装alsa-lib-devel.x86_64后,重新编译安装adl.

再编译程序,声音就出来了.....

你可能感兴趣的:(available,audio,sdl,device,No)