“Gtk-WARNING **:无法打开显示:”当在Eclipse中运行gtkmm项目时 [英] "Gtk-WARNING **: cannot open display:" when running a gtkmm project in Eclipse
问题描述
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屋!