2

I'm following this guide to install snort on my Debian Linux. In step 2 while executing the command 'Make' to build libpcap I'm getting the error '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
3



As others have mentioned, the problem is that you can't find the missing dependency bluetooth/mgmt.h.

A more direct way than those mentioned above to resolve your problem is to create a custom include directory in which you will copy the missing header:

# ${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"

See if that works

3

The message is telling you that you are missing a dependency to compile the application. Using apt-file, you can easily find which packages contains the relevant file:

# apt-file update
# apt-file search bluetooth/mgmt.h
linux-headers-3.16.0-4-common: /usr/src/linux-headers-3.16.0-4-common/include/net/bluetooth/mgmt.h

The package name may be different depending on the version of Debian you are running.

1

Make can't find a dependency. You either don't have the file (most likely) or you installed it in a non-standard place. Make sure have the bluetooth-dev package installed:

sudo aptitude install libbluetooth-dev

Edit: User @jordanm has a better, generic way to find the file you are missing, but if you are using wheezy it is in the libbluetooth-dev package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.