sane icon indicating copy to clipboard operation
sane copied to clipboard

go build for arm failed: github.com/tjgq/sane/frame.go:14:15: undefined: Format

Open Ghardo opened this issue 6 years ago • 2 comments

Hello,

i want to compile my code for raspberry pi on manjaro but i got this error

env GOOS=linux GOARCH=arm GOARM=7 go build
 # github.com/tjgq/sane
../../github.com/tjgq/sane/frame.go:14:15: undefined: Format

Ghardo avatar Jan 22 '19 22:01 Ghardo

I think this happens because Format is defined in sane.go, which uses cgo, and cgo is disabled by default when cross-compiling. You need to set the CGO_ENABLED and CC environment variables. (Search for "cross-compiling" in https://golang.org/cmd/cgo/).

Alternatively, you can avoid cross-compilation by building directly on your Raspberry PI.

tjgq avatar Jan 23 '19 01:01 tjgq

thanks i compilied it on the raspberry it works now but i got weird scan result on the pi. scanimage works fine and the scan results are ok

need more time to debug

[edit] raspberry pi 3+ => nice scan results raspberry zero w => weird scan results

Ghardo avatar Jan 24 '19 19:01 Ghardo