gdbus库名称是什么?技术找到了吗? [英] What is the gdbus library name? Technique to find it?

查看:82
本文介绍了gdbus库名称是什么?技术找到了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Bluez gdbus.h函数需要包括什么库?我在gdbus.h函数中遇到很多undefined reference错误,因此显然我缺少一个库.

What library do I need to include to use Bluez gdbus.h functions? I am getting alot of undefined reference errors for gdbus.h functions so I obviously I am missing a library.

*是否可以(在终端或其他方式)找出头文件使用的库?例如;我可以使用locate gdbus.h找到头文件所在的位置.有没有办法找出gdbus.h需要什么库?

*Is there a way (in terminal or otherwise) I can find out what library a header file uses? For example; I can find where a header file resides using locate gdbus.h. Is there a way I can find out what library gdbus.h requires?

我当前的pkg-config是:

pkg-config --cflags gio-2.0 dbus-glib-1 dbus-1 glib-2.0 gthread-2.0
pkg-config --libs gio-2.0 dbus-glib-1 dbus-1 glib-2.0 gthread-2.0

pkg-config --cflags gio-2.0 dbus-glib-1 dbus-1 glib-2.0 gthread-2.0
pkg-config --libs gio-2.0 dbus-glib-1 dbus-1 glib-2.0 gthread-2.0

有了这个,我得到了许多未定义的引用,例如:

With this I get many undefined references such as:

agent.c:100:对'g_dbus_send_reply'的未定义引用
agent.c:104:对'g_dbus_send_reply'的未定义引用
agent.c:107:对'g_dbus_send_error'的未定义引用

agent.c:100: undefined reference to 'g_dbus_send_reply'
agent.c:104: undefined reference to 'g_dbus_send_reply'
agent.c:107: undefined reference to 'g_dbus_send_error'

我缺少哪个图书馆?

推荐答案

gdbus函数是gio库的一部分,因此gio-2.0包正是您想要的.

The gdbus functions are part of the gio library, so the gio-2.0 package is what you want.

找不到gdbus/gdbus.h的原因是它不存在.我什至没有提供gdbus.h的程序包,更不用说gdbus/gdbus.h了.要包含的正确文件是gio/gio.h,它将包含整个gio库的所有必要头,包括gdbus的22.

The reason gdbus/gdbus.h isn't found is that it doesn't exist. I don't even have a package which provides a gdbus.h, much less gdbus/gdbus.h. The right file to include is gio/gio.h, which will include all the necessary headers for the entire gio library, including the 22 for gdbus.

摆脱dbus-glib-1;不推荐使用(建议使用gdbus).如果您的代码使用gdbus,则不太可能还需要dbus-glib.

Get rid of dbus-glib-1; it's deprecated (in favor of gdbus). If your code uses gdbus it's very unlikely it also requires dbus-glib.

这篇关于gdbus库名称是什么?技术找到了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆