我正在编辑并重新编译bluez 5.31版的hcitool.c。我从这个回答下列程序安装的bluez 5.31: Bluetooth Low Energy in C - using Bluez to create a GATT server如何重新编译现有的linux应用程序
在我的试用,我复制了hcitool.c文件,并将其命名为Tools文件夹内myhcitool.c我用命令
gcc -o myhcitool.o myhcitool.c.
这给了我一个错误
myhcitool.c:43:27: fatal error: lib/bluetooth.h: No such file or directory
#include "lib/bluetooth.h"
^
compilation terminated.
我试图复制工具文件夹以外的myhcitool.c并编译它。这给了我这样的一堆错误的东西:
/tmp/ccj1QmZK.o: In function `dev_info':
myhcitool.c:(.text+0x293): undefined reference to `ba2str'
/tmp/ccj1QmZK.o: In function `conn_list':
myhcitool.c:(.text+0x501): undefined reference to `ba2str'
myhcitool.c:(.text+0x50f): undefined reference to `hci_lmtostr'
myhcitool.c:(.text+0x586): undefined reference to `bt_free'
/tmp/ccj1QmZK.o: In function `cmd_dev':
我也试图通过在那里修改简单的printf编辑hcitool.c本身,然后重新进行“化妆”和“使安装”整个命令bluez的。之后,当我尝试运行hcitool时,我所做的修改没有任何效果。
你以前做过“干净”吗? – Downvoter
没有。我现在就试了一下。 –
我刚试过'make clean',然后重做'./configure','make'和'make install'。我在hcitool中的修改仍然不起作用。 –