Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Linux Programming
  4. How to find what name and where the (bluetooth) library is located?

How to find what name and where the (bluetooth) library is located?

Scheduled Pinned Locked Moved Linux Programming
databasedata-structurestutorialquestion
4 Posts 3 Posters 40 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    It is against my conviction to use "blueZ' but .... I am trying locate the actual library to link my program with. From experience I know the file names change so I really do not know what to search for bluez ... bluetooth..libbluetooth... libbluetooth.so... I decided to remove and install and hoped for answers.. No go! What name am I looking for and where is such file located? Cheers q5@q5-desktop:~$ sudo apt-get remove libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: libbluetooth-dev 0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded. After this operation, 847 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 195509 files and directories currently installed.) Removing libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$ sudo apt-get install libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: libbluetooth-dev 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/252 kB of archives. After this operation, 847 kB of additional disk space will be used. Selecting previously unselected package libbluetooth-dev:amd64. (Reading database ... 195466 files and directories currently installed.) Preparing to unpack .../libbluetooth-dev_5.60-0ubuntu2.2_amd64.deb ... Unpacking libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... Setting up libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$

    K L M 3 Replies Last reply
    0
    • L Lost User

      It is against my conviction to use "blueZ' but .... I am trying locate the actual library to link my program with. From experience I know the file names change so I really do not know what to search for bluez ... bluetooth..libbluetooth... libbluetooth.so... I decided to remove and install and hoped for answers.. No go! What name am I looking for and where is such file located? Cheers q5@q5-desktop:~$ sudo apt-get remove libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: libbluetooth-dev 0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded. After this operation, 847 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 195509 files and directories currently installed.) Removing libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$ sudo apt-get install libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: libbluetooth-dev 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/252 kB of archives. After this operation, 847 kB of additional disk space will be used. Selecting previously unselected package libbluetooth-dev:amd64. (Reading database ... 195466 files and directories currently installed.) Preparing to unpack .../libbluetooth-dev_5.60-0ubuntu2.2_amd64.deb ... Unpacking libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... Setting up libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$

      K Offline
      K Offline
      k5054
      wrote on last edited by
      #2

      Short answer is you don't need to know. When linking your program with -lbluetooth should be enough, if it's installed in the usual place. Depending on what your development environment is, you can use pkg-config to tell you what flags you need to use to find headers and libs e.g

      k5054@localhost:~$ pkg-config --cflags bluez

      k5054@localhost:~$ pkg-config --libs bluez
      -lbluetooth
      k5054@localhost:~$

      This tells us that we don't need any additional flags for compilation, and only need to add -lbluetooth when linking. If you really want to know where the lib is, you can use dpkg to tell you where it is

      k5054@localhost:~$ dpkg -S libbluetooth | grep .so
      libbluetooth3:amd64: /usr/lib/x86_64-linux-gnu/libbluetooth.so.3
      libbluetooth3:amd64: /usr/lib/x86_64-linux-gnu/libbluetooth.so.3.19.3
      libbluetooth-dev:amd64: /usr/lib/x86_64-linux-gnu/libbluetooth.so
      k5054@localhost:~$

      Note that debian/ubuntu uses the target architecture as part of the filename for libraries, so for a PI with a 32 bit Raspberry Pi OS, the path is /usr/lib/arm-linux-gnueabihf/libbluetooth.so.3, and it would be different again for a PI with a 64-bit OS, or an i386, MIPS, etc.

      Keep Calm and Carry On

      1 Reply Last reply
      0
      • L Lost User

        It is against my conviction to use "blueZ' but .... I am trying locate the actual library to link my program with. From experience I know the file names change so I really do not know what to search for bluez ... bluetooth..libbluetooth... libbluetooth.so... I decided to remove and install and hoped for answers.. No go! What name am I looking for and where is such file located? Cheers q5@q5-desktop:~$ sudo apt-get remove libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: libbluetooth-dev 0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded. After this operation, 847 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 195509 files and directories currently installed.) Removing libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$ sudo apt-get install libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: libbluetooth-dev 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/252 kB of archives. After this operation, 847 kB of additional disk space will be used. Selecting previously unselected package libbluetooth-dev:amd64. (Reading database ... 195466 files and directories currently installed.) Preparing to unpack .../libbluetooth-dev_5.60-0ubuntu2.2_amd64.deb ... Unpacking libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... Setting up libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Member 14968771 wrote:

        The following NEW packages will be installed: libbluetooth-dev

        So the option to use in your build should be -lbluetooth-dev. But you also need to check that it is installed in one of the automatically searched locations. The names of these will be in the environment variable LD_LIBRARY_PATH. If the library is not in one of those places then you can: 1. Add its name to the envoronment variable, or 2. Use the -L option on the build.

        1 Reply Last reply
        0
        • L Lost User

          It is against my conviction to use "blueZ' but .... I am trying locate the actual library to link my program with. From experience I know the file names change so I really do not know what to search for bluez ... bluetooth..libbluetooth... libbluetooth.so... I decided to remove and install and hoped for answers.. No go! What name am I looking for and where is such file located? Cheers q5@q5-desktop:~$ sudo apt-get remove libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: libbluetooth-dev 0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded. After this operation, 847 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 195509 files and directories currently installed.) Removing libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$ sudo apt-get install libbluetooth-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libfwupdplugin1 Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: libbluetooth-dev 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/252 kB of archives. After this operation, 847 kB of additional disk space will be used. Selecting previously unselected package libbluetooth-dev:amd64. (Reading database ... 195466 files and directories currently installed.) Preparing to unpack .../libbluetooth-dev_5.60-0ubuntu2.2_amd64.deb ... Unpacking libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... Setting up libbluetooth-dev:amd64 (5.60-0ubuntu2.2) ... q5@q5-desktop:~$

          M Offline
          M Offline
          Member 15788959
          wrote on last edited by
          #4

          nice

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups