“Gtk-WARNING **:无法打开显示:”当在Eclipse中运行gtkmm项目时 [英] "Gtk-WARNING **: cannot open display:" when running a gtkmm project in Eclipse

查看:610
本文介绍了“Gtk-WARNING **:无法打开显示:”当在Eclipse中运行gtkmm项目时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Eclipse CDT(Ubuntu)上运行一个gtkmm项目。该项目编译正常,没有报告错误,但是当我尝试运行项目时,控制台打印出这个消息

 Gtk -WARNING **:无法打开显示:

如果我去可执行文件所在的位置,鹦鹉螺,我可以打开它,运行正常。这是一个直接从Eclipse运行的问题。



谢谢,

解决方案>

这听起来像是在eclipse使用的环境中没有设置DISPLAY环境变量来启动你的应用程序。



要查看这一点,请编辑您尝试启动的程序的运行配置。接下来,选择环境选项卡。如果已经设置了 DISPLAY 变量,请确保它是正确的(通常应该是:0.0)。如果没有,创建一个并设置为:0.0。


I'm trying to run a gtkmm project in Eclipse CDT (On Ubuntu). The project compiles fine, there are no errors reported but when I try to run the project the console prints out this message

"Gtk-WARNING **: cannot open display:"

If I go to where the executable is located, in nautilus, I can open it and it runs fine. It's just a problem when trying to run directly from Eclipse.

Thanks,

解决方案

It sounds like the the "DISPLAY" environment variable is not being set in the environment used by eclipse to launch your application.

To check this, Edit the Run Configuration for the the program you are trying to launch. Next, select the Environment tab. If there is a DISPLAY variable already set, make sure it is correct (usually it should be ":0.0"). If there is not one, create one and set it to ":0.0".

这篇关于“Gtk-WARNING **:无法打开显示:”当在Eclipse中运行gtkmm项目时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆