免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8648 | 回复: 2
打印 上一主题 下一主题

请教SDL编程,SDL_Init No available video device [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-14 23:38 |只看该作者 |倒序浏览
请教SDL相关编程,
编写相关程序,在编译成功后,运行程序的时候提示错误:
     SDL_Init No available video device

官网的解释是:
网址为: http://www.libsdl.org/faq.php?ac ... s&category=3#25

摘录关键如下:
Q: I get the error: "no video devices available"
A: SDL doesn't use the X11 video driver if it can't open the X display, and if no other drivers are available, it will report this error.
To fix this, set your display environment variable appropriately:
sh: DISPLAY=:0 ; export DISPLAY
csh: setenv DISPLAY :0
If you still have problems, try running xhost + localhost
Finally, if all those didn't work, and you built SDL from source, make sure that you have the X11 development libraries installed, otherwise you'll get a version of SDL that doesn't include X11 display support. After you install the X development libraries, you need to "make clean" and then rerun the configure and build process.

也不大明白应该怎么操作,希望懂的牛人能帮助下
谢谢!

我用的OS是 Ubuntu 7.10
SDL源码库为 SDL-1.2.13.tar.gz

论坛徽章:
0
2 [报告]
发表于 2009-05-18 18:48 |只看该作者
找不到设备,是不是没启动xserver图形界面呀?

论坛徽章:
0
3 [报告]
发表于 2009-05-19 22:33 |只看该作者
ubuntu 默认的就应该是图形界面启动啊...
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP