什么取代libbluetooth1-dev使用BlueZ进行C编程?

问题描述:

我想在C上使用BlueZ在蓝牙项目上工作,我正在按照教程进行指导,但它已经有几年了,我认为它使用的库现在已被弃用(libbluetooth1-dev)。什么取代libbluetooth1-dev使用BlueZ进行C编程?

Here是教程,在该部分的编译行需要的库bluetooth,我相信你会从执行this页的教程,但是在这个错误页面结果运行的apt-get命令了:

Package bluez-utils is not available, but is referred to by another package. 
This may mean that the package is missing, has been obsoleted, or 
is only available from another source 
However the following packages replace it: 
    bluez 

E: Unable to locate package libbluetooth1-dev 
E: Package 'bluez-utils' has no installation candidate 

任何帮助将不胜感激。

+0

这是旧的,但是你可以从你的发行版的存档镜像中得到它,就像你写的那样。所以建立镜子。 – Koshinae

+0

哦,并且正如消息所述,您可以尝试使用'bluez'包。 – Koshinae

+0

@Koshinae我已经安装了bluez,但是我不知道如何在我的程序中使用它 - 本教程中提到要将“-lbluetooth”添加到编译命令中,但这不适用于我,我认为这是由于这个。我试过'-lbluez'和变体没有成功。另外,我对使用废弃库的假设是有被弃用的一个原因,我会想象替换中的某个地方的功能。 –

在找到another * question之后我管理整理出来 - 我需要运行apt-get install libbluetooth-dev(不是libbluetooth1-dev,如本教程所述),然后按指示进行编译。 apt-get安装了libbluetooth-devlibbluetooth3这是libbluetooth的当前版本。