Debian

製作:目標“pcap-bt-monitor-linux.o”的配方失敗

  • March 9, 2019

我正在按照本指南在我的 Debian Linux 上安裝 snort。在步驟 2 中執行命令“Make”以建構 libpcap 時,我收到錯誤“recipe for target ‘pcap-bt-monitor-linux.o’ failed”

gcc -fpic -I.  -DHAVE_CONFIG_H  -D_U_="__attribute__((unused))" -g -O2 -c ./pcap-bt-monitor-linux.c
./pcap-bt-monitor-linux.c:42:28: fatal error: bluetooth/mgmt.h: No such file or directory
#include <bluetooth/mgmt.h>
                       ^
compilation terminated.
Makefile:83: recipe for target 'pcap-bt-monitor-linux.o' failed
make: *** [pcap-bt-monitor-linux.o] Error 1

正如其他人所提到的,問題是您找不到缺少的依賴項 bluetooth/mgmt.h。

比上面提到的更直接的方法來解決您的問題是創建一個自定義包含目錄,您將在其中複製缺少的標頭:

# ${source_dir} is the dir where you're using make
# creating custom include directory
mkdir -p ${source_dir}/include/bluetooth

# downloading the missing header into it
curl https://projects.archlinux.org/svntogit/packages.git/plain/trunk/mgmt.h?h=packages/libpcap -o ${source_dir}/include/bluetooth/mgmt.h

# Adding the custom include directory to the include path
export CFLAGS="$CFLAGS -I${source_dir}/include"

看看這是否有效

引用自:https://unix.stackexchange.com/questions/229295