建筑 qtconnectivity bluez 缺失

Building qtconnectivity bluez missing

本文关键字:缺失 bluez qtconnectivity 建筑      更新时间:2023-10-16

我正在尝试从源代码(修订版 5.12.3(为我的主机系统(Ubuntu 18.04 VM(构建 qtconnectivity。 当我尝试在项目文件上运行qmake时,出现此错误:

Project ERROR: Could not find feature bluez.

我安装了每个该死的 bluez 软件包,但蓝牙守护程序没有运行,我想这就是问题所在。以下是我已安装的蓝牙相关软件包列表:

udo apt list --installed | grep 'bluez|bluetooth'
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
bluetooth/bionic-updates,bionic-updates,bionic-security,bionic-security,now 5.48-0ubuntu3.4 all [installed]
bluez/bionic-updates,bionic-security,now 5.48-0ubuntu3.4 amd64 [installed,automatic]
bluez-cups/bionic-updates,bionic-security,now 5.48-0ubuntu3.4 amd64 [installed,automatic]
bluez-obexd/bionic-updates,bionic-security,now 5.48-0ubuntu3.4 amd64 [installed,automatic]
bluez-tools/bionic,now 0.2.0~20140808-5build1 amd64 [installed]
gir1.2-gnomebluetooth-1.0/bionic-updates,now 3.28.0-2ubuntu0.2 amd64 [installed,automatic]
libbluetooth-dev/bionic-updates,bionic-security,now 5.48-0ubuntu3.4 amd64 [installed]
libbluetooth3/bionic-updates,bionic-security,now 5.48-0ubuntu3.4 amd64 [installed,automatic]
libbluetooth3-dbg/bionic-updates,bionic-security,now 5.48-0ubuntu3.4 amd64 [installed,auto-removable]
libgnome-bluetooth13/bionic-updates,now 3.28.0-2ubuntu0.2 amd64 [installed,automatic]
libqt5bluetooth5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,auto-removable]
libqt5bluetooth5-bin/bionic,now 5.9.5-0ubuntu1 amd64 [installed,auto-removable]

有人知道如何解决此错误吗?

通常,您需要安装-dev包才能在编译中使用库。

以下是 qtconnectivity 使用的测试:https://github.com/qt/qtconnectivity/blob/dev/config.tests/bluez/main.cpp。您需要一个包含bluetooth/bluetooth.h的包。

在包内容中按文件名搜索会显示libbluetooth-dev