1

I've been playing around with Google Go, I love the power behind it and decided to try out some libraries. I tried using goinstall to install github.com/mattn/go-gtk/gtk but when I try to compile an example I'm getting:

can't find import: github.com/mattn/go-gtk/gtk

I've heard that others have problems with goinstall, is there anything I can do to fix this? I also saw that some people fixed this by putting the path as something like github.com/mattn/go-gtk/gtk/gtk.so but it's still not working for me.

Isaiah
  • 1,995
  • 2
  • 18
  • 29

2 Answers2

2

Use:

go install github.com/mattn/go-gtk/gtk

and it will download and install this library in $GOPATH/src

scaganoff
  • 1,830
  • 1
  • 16
  • 19
  • Unfortunately, some sort of wizardry is needed to tell go to look in `$GOPATH/src` for the package `gtk` when a program includes `import "gtk"` – weberc2 Jan 10 '13 at 00:07
  • 1
    `$ go install github.com/mattn/go-gtk/gtk can't load package: package github.com/mattn/go-gtk/gtk: cannot find package "github.com/mattn/go-gtk/gtk" in any of: /usr/lib/go/src/pkg/github.com/mattn/go-gtk/gtk (from $GOROOT) ($GOPATH not set) ` - not working –  Feb 19 '14 at 09:12
0

Use following command to install necessary packages

go get github.com/mattn/go-gtk 
olyanren
  • 1,448
  • 4
  • 24
  • 42