Error: Unable to initialize gtk, is DISPLAY set properly?

眉间皱痕 提交于 2019-12-07 12:35:27

问题


I'm trying to run Image application from server "bert"

I connected through my OSX Maverick as

ssh ak324@bert.eecs.qmul.ac.uk

I compiled my file with

$ make

but when I run the resulting file

$ ./window

it gives me the following error:

Error: Unable to initialize gtk, is DISPLAY set properly?

How can I solve this problem?


回答1:


You should connect with the -X or -Y option to be able to launch graphical applications:

ssh -X ak324@bert.eecs.qmul.ac.uk

If that doesn't help, you should consult /etc/ssh/sshd_config whether X11Forwarding is enabled.




回答2:


On macOS you need to install xquartz for x11 support https://support.apple.com/de-de/HT201341.

Then you can connect with

ssh -Y ak324@bert.eecs.qmul.ac.uk


来源:https://stackoverflow.com/questions/21878489/error-unable-to-initialize-gtk-is-display-set-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!