8

I'm trying to cross-compile glib for gstreamer but encountered the following error in Ubuntu 16.04 terminal:

checking for LIBMOUNT... no
checking libmount/libmount.h usability... no
checking libmount/libmount.h presence... no
checking for libmount/libmount.h... no
configure: error: *** Could not find libmount

Greatly appreciate any advice from the community.

rainfrost
  • 377
  • 2
  • 6
  • 12

3 Answers3

7

I would've preferred to add this as a comment, but unless you actually need libmount for something it's much easier to simply disable it by passing --enable-libmount=no to configure.

Frenzie
  • 106
  • 1
  • 2
2

you need the library with headers ... package names ending in -dev contain headers

apt-get install libmount-dev

this will give you the missing headers ... to verify issue

dpkg -L libmount-dev

#  ... output

/.
/usr
/usr/include
/usr/include/libmount
/usr/include/libmount/libmount.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libmount.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/mount.pc
/usr/share
/usr/share/doc
/usr/share/doc/libmount-dev
/usr/share/doc/libmount-dev/copyright
/usr/lib/x86_64-linux-gnu/libmount.so
/usr/share/doc/libmount-dev/changelog.Debian.gz
Scott Stensland
  • 2,673
  • 2
  • 25
  • 24
0

You need to cross-compile libmount and make it available to the cross-compiler (and presumably cross-pkg-config).

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • so basically i'd need to cross-compile every dependencies to fit my embedded target architecture right? that said i'm not able to find libmount package to cross-compile. do you've any recommended link to download the libmount source? – rainfrost Dec 01 '16 at 01:49
  • 2
    Yes, you need to cross-compile every dependency (or use a toolchain which includes them, if such a thing exists for your target). `libmount` is part of [`util-linux`](https://www.kernel.org/pub/linux/utils/util-linux/). – Stephen Kitt Dec 01 '16 at 05:09
  • just another question, if I install e.g. apt-get install libmount, it only installs the sources, when i'm cross-compiling, does the cross-compiler knows to grab the libmount source and cross-compile for my target? – rainfrost Dec 01 '16 at 06:33
  • @emddev sorry, I didn't see a notification for your further question. `apt-get install` doesn't install sources, and the cross-compiler doesn't know to grab the source and cross-compile automatically; you need to explicitly cross-compile all the required libraries. If your target matches an Ubuntu architecture, you could use multi-arch instead. (`apt-get source` will download the source code, but it won't install it in a pre-defined location, it just extracts it in the current directory.) – Stephen Kitt Feb 25 '17 at 11:02
  • @StephenKitt thanks for the mentioning of `util-linux`, I have searched for hours before I saw your comment – Felix Xu Apr 26 '21 at 13:47