开发者

"Gtk-WARNING **: cannot open display:" when running a gtkmm project in Eclipse

开发者 https://www.devze.com 2023-02-28 11:15 出处:网络
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 mess

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".

0

精彩评论

暂无评论...
验证码 换一张
取 消