h2non / bimg

Go package for fast high-level image processing powered by libvips C library
https://pkg.go.dev/github.com/h2non/bimg?tab=doc
MIT License
2.65k stars 337 forks source link

Error trying to cross-compile to Linux #342

Open NathanClassen opened 4 years ago

NathanClassen commented 4 years ago

I am trying to build

GOOS=linux go build main.go imgHandler.go

And get this error:

# github.com/h2non/bimg
../../../go/src/github.com/h2non/bimg/image.go:93:49: undefined: Gravity
../../../go/src/github.com/h2non/bimg/image.go:133:29: undefined: Watermark
../../../go/src/github.com/h2non/bimg/image.go:139:34: undefined: WatermarkImage
../../../go/src/github.com/h2non/bimg/image.go:152:26: undefined: Angle
../../../go/src/github.com/h2non/bimg/image.go:176:31: undefined: Interpretation
../../../go/src/github.com/h2non/bimg/image.go:197:27: undefined: Options
../../../go/src/github.com/h2non/bimg/image.go:207:29: undefined: ImageMetadata
../../../go/src/github.com/h2non/bimg/image.go:213:35: undefined: Interpretation
../../../go/src/github.com/h2non/bimg/image.go:229:25: undefined: ImageSize
../../../go/src/github.com/h2non/bimg/resize.go:11:27: undefined: Options
../../../go/src/github.com/h2non/bimg/resize.go:11:27: too many errors
grizzly-monkey commented 4 years ago

Same here when running on Mac.

jackzard commented 4 years ago

use args CGO_ENABLED=1 when build.