1

I'm trying to work on a bluetooth project in C using BlueZ on Linux and I'm following a tutorial for guidance, but it's quite a few years old and I think the library it uses is now deprecated (libbluetooth1-dev).

Here is the tutorial, the compilation line in that section requires the library bluetooth which I believe you would have got from performing this page of the tutorial, however running the apt-get command on that page results in this error:

Package bluez-utils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  bluez

E: Unable to locate package libbluetooth1-dev
E: Package 'bluez-utils' has no installation candidate

Any help would be greatly appreciated.

Harvey Adcock
  • 929
  • 1
  • 7
  • 16
  • It's old, but you can get it from an archive mirror of your distro, as you wrote. So set up the mirror. – Koshinae Jul 04 '16 at 14:10
  • Oh, and as the message states, you could try the package `bluez` instead. – Koshinae Jul 04 '16 at 14:14
  • @Koshinae I have bluez installed, but I don't know how to use it in my program - the tutorial says to add `-lbluetooth` to the compilation command, but this doesn't work for me and I assume it's due to this. I've tried `-lbluez` and variations without success. Also my assumption about using a deprecated library would be there's a reason for it being deprecated and I would imagine the functionality is there somewhere in the replacement. – Harvey Adcock Jul 04 '16 at 14:46
  • 1
    The official supported interface is the [bluez DBUS APIs](https://github.com/r10r/bluez/tree/master/doc). It is a bit of a learning curve to start using it but would advise doing so. If you really want to use libbluetooth then probably best to build it from source. – kaylum Jul 04 '16 at 23:29

1 Answers1

0

Managed to sort it out in my case after finding another stackoverflow question - I needed to run apt-get install libbluetooth-dev (not libbluetooth1-dev as the tutorial said) and then compile as instructed. The apt-get installed libbluetooth-dev and libbluetooth3 which is the current version of libbluetooth.

Community
  • 1
  • 1
Harvey Adcock
  • 929
  • 1
  • 7
  • 16