webp icon indicating copy to clipboard operation
webp copied to clipboard

MAC下怎么编译

Open rebider opened this issue 4 years ago • 5 comments

rebider avatar May 08 '20 19:05 rebider

配置好cgo环境,正常使用就行。你是遇到什么问题了吗

chai2010 avatar May 08 '20 23:05 chai2010

2020-05-08 15:37:24.211 go build -o ./bin/1.0.9/linux_amd64/img-srv main.go 2020-05-08 15:37:24.641 [FATA] Error: build failed: # github.com/chai2010/webp /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:17:9: undefined: webpGetInfo /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:21:20: undefined: webpDecodeGray /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:34:20: undefined: webpDecodeRGB /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:47:20: undefined: webpDecodeRGBA /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:63:14: undefined: webpDecodeGrayToSize /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:77:14: undefined: webpDecodeRGBToSize /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:91:14: undefined: webpDecodeRGBAToSize /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:104:7: undefined: toGrayImage /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:105:14: undefined: webpEncodeGray /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:114:14: undefined: webpEncodeRGB /Users/bb/go/pkg/mod/github.com/chai2010/[email protected]/webp.go:114:14: too many errors

是少了什么东西么?

rebider avatar May 09 '20 08:05 rebider

xcode也装了,是不是gif那里要去除引用?

rebider avatar May 09 '20 08:05 rebider

应该是我用了goframe 的工具 来做发布 gf build main.go 就会出现这个情况 go build main.go 倒是可以生成

rebider avatar May 09 '20 08:05 rebider

可能是这个工具对cgo不友好。遇到问题时建议优先用官方的go getgo build

chai2010 avatar May 09 '20 08:05 chai2010