300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > macbook交叉编译linux mac交叉编译到Linux报错

macbook交叉编译linux mac交叉编译到Linux报错

时间:2020-04-19 08:23:18

相关推荐

macbook交叉编译linux mac交叉编译到Linux报错

我在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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。