修复:connectToBus() Connection Error(Using X11 for dbus-daemon autolaunch was disabled at compile time

1. 问题:d-bus 在 dbus-daemon 没有运行起来的环境中会报这个错:
connectToBus() Connection Error(Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

2. 解决方法:
在运行程序之前,先执行这个命令,把dbus-daemon 先运行起来
$ export $(dbus-launch)

3. 网上的解决方法详细说明过程
原文解决办法链接

When I tried to run notify-send on my laptop running Gentoo, it didn’t work and was given the following message:

$ notify-send ‘hello’
Connecting to D-Bus failed: Using X11 for dbus-daemons autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

How do one set DBUS_SESSION_BUS_ADDRESS? Accoridng to this, it can be done by running:

$ export $(dbus-launch)

你可能感兴趣的:(嵌入式移植)