在 Ubuntu/Linux 上,我这样做了:
hg clone https://godag.googlecode.com/hg/ godag
之后:
go run mk.go install
它给了我这个错误:
up 2 date: utilz/stringbuffer
up 2 date: utilz/walker
up 2 date: utilz/stringset
up 2 date: utilz/global
up 2 date: utilz/handy
up 2 date: utilz/say
up 2 date: utilz/timer
up 2 date: parse/gopt
up 2 date: cmplr/dag
up 2 date: cmplr/gdmake
up 2 date: cmplr/compiler
up 2 date: start/main
linking : /usr/lib/go/bin/gd
cannot create /usr/lib/go/bin/gd: No such file or directory
2014/10/05 11:05:40 [ERROR] exit status 1
exit status 1
尝试过sudo go run mk.go -B=gcc install
,但还是出现同样的错误。在 Google 上搜索了这个问题,并尝试了所有可能的组合,但还是没有成功。
答案1
该错误可能是因为目录/usr/lib/go/bin/
不存在:
$ sudo go run mk.go install
compiling: utilz/stringbuffer
# ...
compiling: start/main
linking : /usr/lib/go/bin/gd
cannot create /usr/lib/go/bin/gd: No such file or directory
2014/10/02 19:14:51 [ERROR] exit status 1
exit status 1
$ ls /usr/lib/go/
doc/ favicon.ico lib/ pkg/ src/
$ sudo mkdir /usr/lib/go/bin
$ sudo go run mk.go install
up 2 date: utilz/stringbuffer
# ...
up 2 date: start/main
linking : /usr/lib/go/bin/gd
只需使用创建目录sudo mkdir /usr/lib/go/bin
就可以了。