英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论