无法找到导入go-gtk

huangapple go评论70阅读模式
英文:

can't find import go-gtk

问题

我一直在尝试使用Google Go,我喜欢它背后的强大功能,并决定尝试一些库。我尝试使用goinstall安装github.com/mattn/go-gtk/gtk,但是当我尝试编译一个示例时,我得到了以下错误信息:

找不到导入项:github.com/mattn/go-gtk/gtk

我听说其他人也遇到了goinstall的问题,有没有什么办法可以解决这个问题?我还看到一些人通过将路径设置为类似github.com/mattn/go-gtk/gtk/gtk.so的方式来解决这个问题,但对我来说仍然不起作用。

英文:

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.

答案1

得分: 2

使用:

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

它将会下载并安装这个库到 $GOPATH/src。

英文:

Use:

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

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

答案2

得分: 0

使用以下命令安装必要的软件包

go get github.com/mattn/go-gtk
英文:

Use following command to install necessary packages

go get github.com/mattn/go-gtk 

huangapple
  • 本文由 发表于 2011年9月10日 14:37:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/7370071.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定