labapart / gattlib

Library to access GATT information from BLE (Bluetooth Low Energy) devices
http://labapart.com/
436 stars 157 forks source link

How to build gatttool #249

Open arkadiy-telegin opened 2 years ago

arkadiy-telegin commented 2 years ago

Could you please add the instructions to build the gatttool to the README.md?

After building the main package as described in README.md, I tried to build examples/gatttool using the same commands:

cd examples/gatttool
mkdir build && cd build
cmake ..
make

However when running cmake .. it produces the following error:

CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:890 (message):
  None of the required 'gattlib' found
Call Stack (most recent call first):
  CMakeLists.txt:26 (pkg_search_module)

Thanks!

HTCmivi commented 1 year ago

In your build directory you should be able to run the code from the terminal directly ->

/build# ./examples/discover/discover D2:1F:73:D5:6A:81 To access gattlib outside of the repo, type -> sudo make install This will install the library in the expected folder (usr/local/lib) Then you need to ensure that usr/local/lib is in your library path -> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" With that the library should be available and the "None of the required 'gattlib' found" error should not appear again.