Home > Mobile >  go building error: lzma.h No such file or directory
go building error: lzma.h No such file or directory

Time:07-11

I'm building payload-dumper-go, and I get this error,

❯ go build
# github.com/spencercw/go-xz
/home/ecarroll/go/pkg/mod/github.com/spencercw/[email protected]/compression.go:36:10: fatal error: lzma.h: No such file or directory
   36 | #include <lzma.h>
      |          ^~~~~~~~
compilation terminated.

CodePudding user response:

Here's an easier way for "next time".

github.com/ssut/payload-dumper-go uses Github Actions for building and testing.

Checking its .github/workflows/build.yml file:

...
steps:
  - name: Install dependencies
    run: |
      sudo apt -y update
      sudo apt -y install git golang liblzma-dev
...

The last quoted line contains the needed dependencies, namely git, golang and liblzma-dev.

CodePudding user response:

I solve this by brute force trying all lzma stuff that Debian had. The actually packaged needed was,

sudo apt install liblzma-dev

packages that didn't work,

  • lzma-dev
  • golang-github-kjk-lzma-dev
  • Related