本文介绍了如何导出DBUS_SESSION_BUS_ADDRESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在嵌入式系统(Yocto Linux)上运行D-Bus并从我的应用程序代码连接到它.

I'm trying to run D-Bus on an embedded system (Yocto Linux) and connect to it from my application code.

调用dbus_bus_get(DBUS_BUS_SESSION, &err);

Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

我意识到我需要首先启动dbus-daemon,所以我已经从命令行运行了dbus-launch.这样会打印出DBUS_SESSION_BUS_ADDRESS的值,但是我该如何以编程方式将其导出?

I realize that I need to start the dbus-daemon first so I have run dbus-launch from the command line. This prints out a value of DBUS_SESSION_BUS_ADDRESS but how could I export it programmatically?

感谢您的帮助

推荐答案

我终于找到了答案,运行以下命令将导出dbus-launch的输出:

I've finally found the answer, running the following command exports the output of dbus-launch:

export $(dbus-launch)

这篇关于如何导出DBUS_SESSION_BUS_ADDRESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 12:35