# Build failed: gio-2.0/lzma.h missing

**URL:** <https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675>\
**Category:** OpenWrt\
**Created:** [February 21, 2022, 4:42pm UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675 "2022-02-21T16:42:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueWaterCrystal](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/bluewatercrystal/32/1543_2.png) [@BlueWaterCrystal](https://hub.mender.io/u/BlueWaterCrystal)\
**Post date:** [February 21, 2022, 4:42pm UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675/1 "2022-02-21T16:42:59Z")

</div>

Hi,

Currently building Mender-3.2.1 for OpenWrt-21.02 x64, but can’t get past this issue.

Host:  
Debian 10  
Musl 8.4  
Gpio 2.58.3

```auto
Building targets
github.com/remyoudompheng/go-liblzma
github.com/mendersoftware/mender/dbus
# github.com/bmatsuo/lmdb-go/lmdb
mdb.c: In function 'mdb_cursor_put':
mdb.c:6535:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (SIZELEFT(fp) < offset) {
         ^
mdb.c:6540:5: note: here
     case MDB_CURRENT:
     ^~~~
# /home/poke/openwrt-mender/openwrt/staging_dir/host/bin/pkg-config --cflags -- gio-2.0 gio-2.0
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gio-2.0', required by 'virtual:world', not found
Package 'gio-2.0', required by 'virtual:world', not found
/home/poke/openwrt-mender/openwrt/staging_dir/host/bin/pkg-config: exit status 1
# github.com/remyoudompheng/go-liblzma
../../vendor/github.com/remyoudompheng/go-liblzma/reader.go:9:10: fatal error: lzma.h: No such file or directory
 #include <lzma.h>
          ^ ~~~~~~~
compilation terminated.

```

Also, would grub2 need to be patched for Mender to work properly? I see patches for uboot.

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [February 21, 2022, 5:24pm UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675/2 "2022-02-21T17:24:13Z")

</div>

have you tried installing the liblzma-dev package on the build machine?

---

<div class="post-metadata">

**Author:** ![BlueWaterCrystal](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/bluewatercrystal/32/1543_2.png) [@BlueWaterCrystal](https://hub.mender.io/u/BlueWaterCrystal)\
**Post date:** [February 22, 2022, 11:57am UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675/3 "2022-02-22T11:57:16Z")

</div>

Yes, liblzma-dev version 5.2.4-1 Is already installed.

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [February 22, 2022, 12:21pm UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675/4 "2022-02-22T12:21:18Z")

</div>

Take a look at the below, it may be helpful, you may need to set some golang env vars. Sorry I don’t know much about golang.

> [@Go error occurred by attempting to build mender master branch via cross compiling](https://hub.mender.io/t/go-error-occurred-by-attempting-to-build-mender-master-branch-via-cross-compiling/1849/20):
>
> Then GOARCH=arm is needed. I also think that you have passed the wrong sysroot as argument, host instead of target. It should be something like this: make CGO\_CFLAGS="--sysroot=$SDKTARGETSYSROOT -I${LIBLZMA\_INSTALL\_PATH}/include" CGO\_LDFLAGS="--sysroot=$SDKTARGETSYSROOT -L${LIBLZMA\_INSTALL\_PATH}/lib" CGO\_ENABLED=1 GOOS=linux GOARCH=arm

---

<div class="post-metadata">

**Author:** ![BlueWaterCrystal](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/bluewatercrystal/32/1543_2.png) [@BlueWaterCrystal](https://hub.mender.io/u/BlueWaterCrystal)\
**Post date:** [February 23, 2022, 11:39am UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675/5 "2022-02-23T11:39:47Z")

</div>

Thanks, turns out that even though the host had the libraries they weren’t enabled in OpenWRT.

I’m using the build script by [rossbcan](https://hub.mender.io/u/rossbcan), I’m not sure what to put in

> export UBOOT\_DIR:=$(BUILD\_DIR)/

As u-boot isn’t being used and grub2 doesn’t seem to live in the build\_dir.

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [February 23, 2022, 2:52pm UTC](https://hub.mender.io/t/build-failed-gio-2-0-lzma-h-missing/4675/6 "2022-02-23T14:52:37Z")

</div>

Sorry, I don’t know the answer to that one.
