webp icon indicating copy to clipboard operation
webp copied to clipboard

trying to compile a project for linux from osx

Open badoet opened this issue 8 years ago • 4 comments

i get this error

$ GOOS=linux GOARCH=amd64 go build main.go                                                                          
# github.com/chai2010/webp
../../github.com/chai2010/webp/webp.go:24: undefined: CBuffer

did i miss anything? thank you (:

badoet avatar Nov 05 '15 14:11 badoet

webp use cgo. cgo is disabled in cross compile env. try this command: GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build main.go.

chai2010 avatar Nov 06 '15 03:11 chai2010

do i need to install the cgo first? i get this error when trying to run that command

ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)

im compiling using go 1.5.1 on osx yosemite

badoet avatar Nov 06 '15 03:11 badoet

cgo is a builtin tool. I think this is a cgo bug in cross compile(clang is default for osx, not for linux).

chai2010 avatar Nov 06 '15 04:11 chai2010

any updates?

puzanov avatar Mar 05 '17 18:03 puzanov