webp icon indicating copy to clipboard operation
webp copied to clipboard

Linux go mod vendor 后,编译出错

Open cppcoffee opened this issue 3 years ago • 6 comments

go mod vendor 后,编译出错,提示无法找到 webp.h 文件

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

# go version
go version go1.15.5 linux/amd64

# go build
# github.com/chai2010/webp
vendor/github.com/chai2010/webp/capi.go:24:18: fatal error: webp.h: No such file or directory
 #include "webp.h"
                  ^
compilation terminated.

cppcoffee avatar Mar 05 '21 03:03 cppcoffee

ls vendor/github.com/chai2010/webp/

目录找不到 testdata / internal / fuzz / bench 文件夹

cppcoffee avatar Mar 05 '21 03:03 cppcoffee

手动拷贝 testdata / internal / fuzz / bench 文件夹到 vendor 里面才编译通过

cppcoffee avatar Mar 28 '21 02:03 cppcoffee

Any fix to this issue? How to use this library in recent go 1.16 module ?

tanvir-retailai avatar Jul 24 '21 07:07 tanvir-retailai

go1.16: add missing files to Go:embed, keep the missing files in the vendor. any PR are welcomed

chai2010 avatar Jul 25 '21 05:07 chai2010

chai you can use something like this in your repo https://github.com/sizeofint/webpanimation/issues/1#issuecomment-894585471

Benau avatar Aug 08 '21 03:08 Benau

https://github.com/ethereum/go-ethereum/blob/master/crypto/secp256k1/dummy.go

I notice this work around to include missing C files in vendor, happy to pick this up if it's ok

jjkoh95 avatar Sep 26 '21 05:09 jjkoh95