#include <gio/gio.h>
#include <libnm/nm-dbus-interface.h>
int main()
{
GDBusProxy *proxy = NULL;
gboolean found = FALSE;
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
// "org.freedesktop.NetworkManager"
NM_DBUS_SERVICE,
//"/org/freedesktop/NetworkManager"
NM_DBUS_PATH,
//"org.freedesktop.NetworkManager"
//NM_DBUS_INTERFACE,
"org.freedesktop.DBus.Properties",
NULL, NULL);
g_assert (proxy != NULL);
g_object_unref (proxy);
return 0;
}
wrx@ubuntu:~/Desktop$ gcc a.c -o a.out -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/
-L/usr/lib/x86_64-linux-gnu -lglib-2.0
/tmp/ccSOt4vE.o: In function `main':
a.c:(.text+0x3c): undefined reference to `g_dbus_proxy_new_for_bus_sync'
a.c:(.text+0x76): undefined reference to `g_object_unref'
collect2: error: ld returned 1 exit status
wrx@ubuntu:~/Desktop$ gcc a.c -o a.out $(pkg-config --cflags --libs glib-2.0)
/tmp/ccOphBNT.o: In function `main':
a.c:(.text+0x3c): undefined reference to `g_dbus_proxy_new_for_bus_sync'
a.c:(.text+0x76): undefined reference to `g_object_unref'
collect2: error: ld returned 1 exit status
可问题是glib库明明就在路径下找得到。。。。
wrx@ubuntu:~$ ls /usr/lib/x86_64-linux-gnu/libglib*
/usr/lib/x86_64-linux-gnu/libglib-2.0.a
/usr/lib/x86_64-linux-gnu/libglib-2.0.so
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
/usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1.3.0
/usr/lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1
/usr/lib/x86_64-linux-gnu/libglibmm_generate_extra_defs-2.4.so.1.3.0
/usr/lib/x86_64-linux-gnu/libglib.so
CMQ具有延迟消息的功能:
CMQ消息定时器允许您为要添加到队列的消息指定初始的不可见时段,称为【飞行状态】。例如,如果您发送一条消息并将 DelaySeconds 参数设置为 45,则使用者在该消息进入队列后的前 45 秒将看不到该消息。DelaySeconds 的默认值为 0。
延迟消息设置范围:指定Queue生产消息时,可增加 DelaySeconds 入参,取值范围为 0-3600s,即消息最长不可见时长为1小时。若为空,则无延迟效果。
使用限制:每个队列处于飞行状态的消息数限制为100万条。若队列中处于飞行状态的消息超过100万条,则新生产的消息在队列中不可见。Topic模式下该能力暂不支持
相似问题