Open smalloff opened 1 year ago
I have the same error on a docker build.
I have the same error on a docker build.
Try this library github.com/nickalie/go-webpbin
@smalloff @Pukka922 try to add env CGO_ENABLED=1
For me Zig worked great as compiler when cross compiling from Windows to Linux.
I used these env variables:
GOOS=linux
GOARCH=amd64
CGO_ENABLED=1
CC="zig cc -target x86_64-linux-musl"
CXX="zig c++ -target x86_64-linux-musl"
Inspired by this article: https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho
Same issue, maintainers helps us out here
Hi! My params for Linux release.
set GOARCH=amd64 set GOOS=linux go build -ldflags "-s -w"
Output:
C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:22:9: undefined: webpGetInfo C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:26:20: undefined: webpDecodeGray C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:39:20: undefined: webpDecodeRGB C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:52:20: undefined: webpDecodeRGBA C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:68:14: undefined: webpDecodeGrayToSize C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:82:14: undefined: webpDecodeRGBToSize C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:96:14: undefined: webpDecodeRGBAToSize C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:109:7: undefined: toGrayImage C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:110:14: undefined: webpEncodeGray C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:119:14: undefined: webpEncodeRGB C:\Users\admin\go\pkg\mod\github.com\chai2010\webp@v1.1.1\webp.go:119:14: too many errors
Installed TDM-GCC OS Windows 10. Golang version 1.18.4
How can I compile for Linux? When building for Windows, there are no errors. Thanks!