go-dht icon indicating copy to clipboard operation
go-dht copied to clipboard

Cross compilation is not working in macOS for raspberry

Open ckbonu opened this issue 6 years ago • 2 comments

env GOOS=linux GOARCH=arm GOARM=5 go build godht.go.

command-line-arguments

./godht.go:24:15: undefined: dht.DHT11 ./godht.go:31:1: undefined: dht.ReadDHTxxWithRetry

This is example1

ckbonu avatar Dec 10 '18 12:12 ckbonu

@d2r2 any ideas how can we migrate c library to gocode calculate the pulse data to actual values so that we can make total code independent of C.

That would be great deal for the people in IOT who wants to go with GO than python.

ckbonu avatar Dec 17 '18 11:12 ckbonu

@ckbonu, hello. I have some historical reasons do not write whole library in Go: read README.md and you will find the answer.

Please, read #20 how to correctly perform "cross compilation". Honestly I don't know how cross complilation works on macOS (but I know how it works on Linux), but I guess you have a mistake in your command line (somehow you should have special c-compilter with ARM target architecture to be installed on your macOS).

Finally, download latest version of library, try to compile on macOS again (if you figure out how to get special c-compilter to you macOS), and let me know what happened.

d2r2 avatar Dec 21 '18 09:12 d2r2