Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C bluetooth/bluetooth.h在Linux中位于何处?_C_Linux_Bluetooth_Ibeacon_Bluez - Fatal编程技术网

C bluetooth/bluetooth.h在Linux中位于何处?

C bluetooth/bluetooth.h在Linux中位于何处?,c,linux,bluetooth,ibeacon,bluez,C,Linux,Bluetooth,Ibeacon,Bluez,我想构建一个基于BlueZ的c文件,但在我的系统中似乎没有bluetooth.h文件 fatal error: bluetooth/bluetooth.h: No such file or directory 我确信蓝牙加密狗运行正常,我已经成功构建了Bluez 更新 就我而言,我在/user/include/bluetooth文件夹中找到bluetooth.h,您需要安装libbluetooth dev包来编译代码 sudo apt-get install libbluetooth-dev

我想构建一个基于BlueZ的c文件,但在我的系统中似乎没有bluetooth.h文件

fatal error: bluetooth/bluetooth.h: No such file or directory
我确信蓝牙加密狗运行正常,我已经成功构建了Bluez

更新


就我而言,我在/user/include/bluetooth文件夹中找到bluetooth.h,您需要安装libbluetooth dev包来编译代码

sudo apt-get install libbluetooth-dev

这将安装蓝牙头文件。

对于Fedora,您可以使用:

sudo dnf install bluez-libs-devel
在CentOS 7:

sudo yum install bluez-libs-devel

所以你知道bluetooth.h在哪里,但你是c编译器却不知道。您需要在编译器目录搜索中包含/user/include/bluetooth这不一定是您面临的问题,但在某些linux发行版上,有提供运行时支持的二进制版本的包,然后是一个单独的“-dev”包,其中包含您需要将自己的程序与提供的库链接起来的内容。也许您没有安装bluez的-dev包。(是的,我知道你找到了一个标题——但可能还有更多的谜题)@ChrisStratton是的。我认为你是对的。将尝试添加dev库。@user3288829这会不会太乏味?我的意思是,如果我以后更改路径,我必须更改每个文件的包含路径。希望
/user/include/bluetooth
在您的帖子中是一个输入错误。如果不是,则可能是您意外地在/user what own/usr下安装了某个内容,该内容应作为标准包含路径的一部分进行提取。不安装此文件是否可以解决此问题?我只需要编译,不允许安装。是的,下载并提取.deb文件,并提供CLFAGS=-I/path/to/libbluetooth dev/headerfiles的include目录。配置BlueZI时,我在Qt中使用bluetooth API,而Qt又在linux上使用bluez,你知道我需要做什么才能将bluez链接到Qt吗?谢谢我想我还得用你发布的那句话来执行安装。@zadane:我不知道,但你应该试试,因为提供的解决方案对我不起作用。原因是官方源代码发行版的make文件正在目录
/usr/include
中搜索,同时标题在
/usr/include/bluetooth
中。我不得不将蓝牙目录中的所有标题复制到
/usr/include
。我希望这有帮助!