本文介绍了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是:

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

With this I get many undefined references such as:

我缺少哪个图书馆?

推荐答案

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库名称是什么?技术找到了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 21:00