No such file as glib.h
Hi,
I am using Ubuntu 16.04 and python 2.7
When I tried downloading metawear using pip it gave me uncompatible version error for gattlib so I tried python setup.py intsall then following error occurs:
running install
running bdist_egg
running egg_info
writing requirements to metawear.egg-info/requires.txt
writing top-level names to metawear.egg-info/top_level.txt
writing dependency_links to metawear.egg-info/dependency_links.txt
writing metawear.egg-info/PKG-INFO
reading manifest file 'metawear.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'MetaWear-SDK-Cpp/.git'
warning: no previously-included files matching 'pycache' found under directory ''
warning: no previously-included files matching '.py[co]' found under directory '*'
writing manifest file 'metawear.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
make: Entering directory '/home/dharmitha/everything/MetaWear-SDK-Cpp'
make: Nothing to be done for 'build'.
make: Leaving directory '/home/dharmitha/everything/MetaWear-SDK-Cpp'
copying MetaWear-SDK-Cpp/dist/release/lib/x64/libmetawear.so -> mbientlab/metawear
copying MetaWear-SDK-Cpp/dist/release/lib/x64/libmetawear.so.0 -> mbientlab/metawear
copying MetaWear-SDK-Cpp/dist/release/lib/x64/libmetawear.so.0.11.4 -> mbientlab/metawear
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/mbientlab
creating build/bdist.linux-x86_64/egg/mbientlab/metawear
copying build/lib/mbientlab/metawear/libmetawear.so -> build/bdist.linux-x86_64/egg/mbientlab/metawear
copying build/lib/mbientlab/metawear/libmetawear.so.0 -> build/bdist.linux-x86_64/egg/mbientlab/metawear
copying build/lib/mbientlab/metawear/init.py -> build/bdist.linux-x86_64/egg/mbientlab/metawear
copying build/lib/mbientlab/metawear/libmetawear.so.0.11.4 -> build/bdist.linux-x86_64/egg/mbientlab/metawear
copying build/lib/mbientlab/metawear/cbindings.py -> build/bdist.linux-x86_64/egg/mbientlab/metawear
copying build/lib/mbientlab/init.py -> build/bdist.linux-x86_64/egg/mbientlab
byte-compiling build/bdist.linux-x86_64/egg/mbientlab/metawear/init.py to init.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/mbientlab/metawear/cbindings.py to cbindings.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/mbientlab/init.py to init.cpython-35.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying metawear.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying metawear.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying metawear.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying metawear.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying metawear.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
mbientlab.pycache.init.cpython-35: module references path
mbientlab.metawear.pycache.init.cpython-35: module references file
creating 'dist/metawear-0.3.1-py3.5.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing metawear-0.3.1-py3.5.egg
removing '/home/dharmitha/everything/software/lib/python3.5/site-packages/metawear-0.3.1-py3.5.egg' (and everything under it)
creating /home/dharmitha/everything/software/lib/python3.5/site-packages/metawear-0.3.1-py3.5.egg
Extracting metawear-0.3.1-py3.5.egg to /home/dharmitha/everything/software/lib/python3.5/site-packages
metawear 0.3.1 is already the active version in easy-install.pth
Installed /home/dharmitha/everything/software/lib/python3.5/site-packages/metawear-0.3.1-py3.5.egg
Processing dependencies for metawear==0.3.1
Searching for gattlib==0.20171002
Doing git clone from https://github.com/mbientlab/pygattlib.git to /tmp/easy_install-wu0f631p/pygattlib.git@master
Checking out master
Best match: gattlib 0.20171002
Processing pygattlib.git@master
Writing /tmp/easy_install-wu0f631p/pygattlib.git@master/setup.cfg
Running setup.py -q bdist_egg --dist-dir /tmp/easy_install-wu0f631p/pygattlib.git@master/egg-dist-tmp-y42tlehh
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/gattservices.cpp:12:0:
src/gattlib.h:16:18: fatal error: glib.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
When I tried locate glib.h this is the output
/usr/include/glib-2.0/glib.h
/usr/include/reglib/reglib.h
/usr/share/doc/libglib2.0-doc/glib/glib.html
/usr/src/linux-headers-4.13.0-36-generic/include/config/blk/dev/bsglib.h
/usr/src/linux-headers-4.13.0-39-generic/include/config/blk/dev/bsglib.h
The packages installed in my environment are:
Package Version
metawear 0.3.1
pip 10.0.1
requests 2.18.4
setuptools 39.0.1
wheel 0.31.0
I tried by downloading depending files of gattlib as well its still giving me the same error. Any help would be really appreciated. Thank you!
Comments
A quick search turned up this thread. Maybe it can help.
https://askubuntu.com/questions/579565/glib-h-make-error-fatal-error-glib-h-no-such-file-or-directory
I already tried downloading libglib2.0-dev but its still giving me the same error. As for with the adding the path to the Makefile I am not sure how to do that. Where should I add the path? This is the makefile https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/5bbf7be238dd16a8a04a9fb9f9c3010e8268c23d/Makefile
That's the Makefile for the C++ SDK, not gattlib.
Just setup a symbolic link that points to "glib-2.0/glib.h" and don't worry about adding additional include paths.
You mean I should add this to setup.py file?
import os
os.symlink("/usr/include/glib-2.0/glib.h", "glib.h")
Sorry if its a very basic question.
I am sorry I mean when I added this to the setup.py file it's still giving me the same error
try:
os.symlink("/usr/include/glib-2.0/glib.h", "/home/dharmitha/everything/$
except OSError as e:
if e.errno != os.errno.EEXIST:
raise
No, you don't need to modify any code / build scripts. Create the link in the terminal and place it in the default C header file path.