Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ghardo opened this issue Jan 22, 2019 · 2 comments

Comments

@Ghardo
Copy link

Ghardo commented Jan 22, 2019

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 Ghardo changed the title go build for arm failed: github.com/tjgq/sane/frame.go:14:15: undefined: Formaf go build for arm failed: github.com/tjgq/sane/frame.go:14:15: undefined: Format Jan 22, 2019
@tjgq
Copy link
Owner

tjgq commented Jan 23, 2019

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.

@Ghardo
Copy link
Author

Ghardo commented Jan 24, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants