1

I compiled, built and packaged GATTLIB library files in Raspberry Pi 3 as directed in https://github.com/labapart/gattlib. But when trying to install the library from the build folder (/home/pi/Downloads/gattlib-src-root/gattlib-master/build) by using

sudo apt-get install gattlib

I got error

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gattlib

Please advise me what is the correct way to install GATTLIB in Raspberry pi 3.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • Apt-get installs packages from repositories, and knows nothing about "build folder". Assuming you've built a .deb package, use sudo dpkg -i pkg-name.deb to install it. – mikewhatever Apr 19 '18 at 21:05
  • Thanks. The correct command was: $ sudo dpkg -i gattlib_0.2-dev_armhf.deb – Paul Tomov Apr 19 '18 at 22:06
  • The installation (depackaging) went without errors but now I cannot locate the installed files: gattlib.h and libgattlib.so. According to the link above I set the installation path as: cpack -DCPACK_PACKAGE_INSTALL_DIRECTORY=/usr/local .. and indeed the CPackSourceConfig.cmake shows it correctly (SET(CPACK_INSTALL_PREFIX "/usr/local") but where are the installed files? I cannot locate them anywhere in the /usr folder. Please advise me. – Paul Tomov Apr 19 '18 at 22:16
  • Now I found that gatlib.h file was installed into /usr/include folder and libgattlib.so file into /usr/lib folder. So the dpkg command did not heed the installation package settings. – Paul Tomov Apr 19 '18 at 22:41
  • I have also a different problem related to libgatlib.so location. When building my VC++ project, the linker complains that: "/usr/bin/ld: cannot find -llibgattlib". But the libgattlib.so path is correctly set. Please advise me what should be the problem. – Paul Tomov Apr 19 '18 at 22:47
  • Could you please open a new question if you have a new or follow-up question? The comment section is not suitable or meant for new questions or extended discussion. You’re welcome to send me a comment with a notification to draw my attention to it. Thanks. – David Foerster Apr 20 '18 at 08:38
  • 2
    Possible duplicate of How do I install a .deb file via the command line? based on @mikewhatever's comment and OP's response. – David Foerster Apr 20 '18 at 08:38
  • Thank you David. Yes, this link also helped me. I have a new question regarding using gattlib in VS2017 VC++ for Linux project for Raspbian on Raspberry Pi3. Here is the link to "How to link libgattlib.so in a VS2017 VC++ for Linux project": https://askubuntu.com/questions/1026726/how-to-link-libgattlib-so-in-a-vs2017-vc-for-linux-project. I was not able to find a useful clue on the net. – Paul Tomov Apr 20 '18 at 15:42
  • Setting:

    1- \<Board IP Address>\usr\lib into Project->Configuration Properties->VC++ Directories->Library Directories 2- gattlib into Project->Configuration Properties->->Linker->Input 3- -lpthread to Project->Configuration Properties->Linker->Command Line

    solved the problem with referencing a remote .so library in a VS 2017 VC++ for Linux project. Hopefully this summary will help somebody else.

    – Paul Tomov Apr 20 '18 at 19:36

1 Answers1

0

The solution on this link worked for me on a Raspberry Pi 3 using Gattlib with Python 3 https://stackoverflow.com/questions/43721463/cant-install-gattlib-on-rasperry-pi-error-stray-xxx-in-program-on-usr-incl

Julian Wise
  • 131
  • 3