我在Mac下修改了文件,编译后可以正常启动。然后我想编译为Linux版本的包。
在makefile中,增加了GOOS=linux GOARCH=amd64,
$(CMD):
GOOS=linux GOARCH=amd64 go build -o bin/$@/falcon-$@ ./modules/$@
.PHONY: $(TARGET)
$(TARGET): $(GOFILES)
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.GitCommit=`git rev-parse --short HEAD` -X main.Version=$(VERSION)" -o open-falcon
然后,出现以下错误。新接触golang,请问我不能这么编译吗?我记得写的测试例子可以的
➜ falcon-plus git:(master) ✗ make all
GOOS=linux GOARCH=amd64 go build -o bin/agent/falcon-agent ./modules/agent
GOOS=linux GOARCH=amd64 go build -o bin/aggregator/falcon-aggregator ./modules/aggregator
GOOS=linux GOARCH=amd64 go build -o bin/graph/falcon-graph ./modules/graph
# /open-falcon/falcon-plus/vendor//open-falcon/rrdlite
vendor//open-falcon/rrdlite/rrd.go:43:8: undefined: i64toa
vendor//open-falcon/rrdlite/rrd.go:95:10: c.create undefined (type *Creator has no field or method create, but does have Create)
vendor//open-falcon/rrdlite/rrd.go:128:11: u.update undefined (type *Updater has no field or method update, but does have Update)
vendor//open-falcon/rrdlite/rrd.go:130:11: u.update undefined (type *Updater has no field or method update, but does have Update)
make: *** [graph] Error 2