linux gtk 编程

linux,ubuntu,debian 2019-09-17 1388 次浏览 次点赞


gtk program

gtk overview

I. design notes

II. troubleshoots

cannot open display

Unable to init server: Could not connect: Connection refused

(example-0:9675): Gtk-WARNING **: cannot open display: 

需要在非root用户 DISPLAY=:0 ./example-0 运行。

同时,x server 限制连接用户。所以如果要通过root调试,会麻烦一些。

export DISPLAY=:0
xhost +                          #第二次运行可能会阻塞
cp /home/pi/.Xauthority /root/   #每次重启后该文件需要重新拷贝。


本文由 Jay 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处,点赞0

还不快抢沙发

添加新评论