nwg-piotr / nwg-look

GTK3 settings editor adapted to work in the wlroots environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined variables when using make build in void linux

sininen-blue opened this issue · comments

I already have go 1.20, gtk+3-devel, xcur2png, glib-devel, and cairo installed all through xbps which I'm pretty sure covers everything. This might be a void specific thing, or I messed something up

Output of make build
`go build -o bin/nwg-look .

github.com/nwg-piotr/nwg-look

./main.go:29:29: undefined: gtk.Settings
./main.go:34:29: undefined: gtk.Viewport
./main.go:35:29: undefined: gtk.ScrolledWindow
./main.go:36:29: undefined: gtk.ListBox
./main.go:37:29: undefined: gtk.MenuBar
./main.go:38:29: undefined: gtk.Grid
./main.go:39:29: undefined: gtk.Grid
./main.go:40:29: undefined: gtk.Frame
./main.go:41:29: undefined: gtk.Box
./main.go:42:29: undefined: gtk.Frame
./main.go:42:29: too many errors
make: *** [Makefile:7: build] Error 1`

Looks like the gotk3 library missing. Did you do make get? Or try manually:

go get github.com/gotk3/gotk3
go get github.com/gotk3/gotk3/gdk
go get "github.com/sirupsen/logrus"
$ make get
go get github.com/gotk3/gotk3
go get github.com/gotk3/gotk3/gdk
go get "github.com/sirupsen/logrus"

completed with no errors, but it still has the same undefined variables

Those are no variables, but types defined in the gotk3 library. If they're missing, the library must be inaccessible. Maybe something wrong with your go path? BTW: do you have gtk3 itself installed?

my path is

$ echo $PATH
/usr/local/bin /bin /usr/bin /usr/local/sbin /usr/sbin /sbin

This might be the problem, but I'm not sure which path to add exactly

Also I do have gtk3 installed

Actually I have no idea what goes wrong on your side. Maybe standard env settings for golang in Arch PKGBUILD are going to help?

export CGO_LDFLAGS="${LDFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external"
export GOPATH="${srcdir}"/go
export PATH=$PATH:$GOPATH/bin
go build -v -o "$pkgname" *.go

If on x86_64, you could also try the nwg-look-v0.2.2_x86_64.tar.gz binary file provides in release assets.

The bin seems to work, though I did have to make my own /usr/share/nwg-look/ folder and move things there. I think I'll just use the bin for now

I'm assuming this is a void linux specific issue since I don't remember facing this last time I tried to build it on fedora

Also thanks for your time

@sininen-blue I was having the exact same issue. Installing gcc-go and pkg-config fixed it.