我如何在ubuntu上安装bluez进行开发?

Ian*_*Ian 5 c ubuntu bluetooth raspberry-pi bluez

初学者问题:

我想在我的Raspberry Pi中使用BlueZ驱动程序以简单的方式连接到我正在编写的iPhone应用程序,但我正在尝试在我的Ubuntu启动时首先对其进行原型设计(我是双启动一个macbook pro w/macOS sierra/Ubuntu 16.04).我无法将蓝牙标题"bluetooth.h"显示在我的c程序中.我尝试过sudo apt-get install bluez,但执行此命令后,我的系统中没有出现bluetooth.h标头.以下是我的原型应用程序的包含:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
Run Code Online (Sandbox Code Playgroud)

当我gcc的程序,我链接到-lbluetooth,但我的系统也找不到该lib.

我应该使用BlueZ,对吧?我已经读过BlueZ是Linux的官方蓝牙堆栈,我打算把Raspbian Jesse放在我的覆盆子pi上; 我只是在理智地检查我是在正确的道路上.

Ian*_*Ian 6

http://docs.cubieboard.org/tutorials/common/development/bluez_programming

看起来本教程有答案,sudo apt-get install bluez安装了驱动程序,但没有相关的开发标题.而是使用sudo apt-get install bluez libbluetooth-dev.现在-lbluetooth被发现是一个lib.