一个奇怪的问题!cannot open display

gomo544409 2004-12-01 08:44:54
我在xwin里面编好的程序,运行正常,
可是我到text端运行时却出象错误
GTK-WARRING: cannot open display!
各位高手帮我分析一下时什么原因,附上包含的头文件:
#include <gtk/gtk.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <ftw.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
非常感谢!!!
...全文
1200 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tukey 2004-12-03
  • 打赏
  • 举报
回复
不好意思,理解错误,一楼是正解
tukey 2004-12-02
  • 打赏
  • 举报
回复
xhost +
watcher_shen 2004-12-02
  • 打赏
  • 举报
回复
运行:
xhost +
试试吧。
yuanlei1978113 2004-12-01
  • 打赏
  • 举报
回复
x server没有启动.
wxywh 2004-12-01
  • 打赏
  • 举报
回复
#include <gtk/gtk.h> <--用到了图形库,当然不能在字符模式下运行了,在GNOME下可以正常运行。
conquer 2004-12-01
  • 打赏
  • 举报
回复
setenv DISPLAY 192.168.0.1:0
指定一个GUI的接受端即可。

23,118

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧