我正在尝试从源代码修订版5.12.3为我的主机系统(Ubuntu 18.04 VM)构建qtconnectivity。当我尝试在项目文件上运行qmake时,出现此错误:
Project ERROR: Could not find feature bluez.
我安装了每个该死的bluez软件包,但是bluetoothd守护程序没有运行,我想是问题所在。这是我已安装的蓝牙相关软件包的列表:
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
的软件包。
search by file name in package contents显示libbluetooth-dev
。