d2r2 / go-i2c

Implementation of I2C-bus written in Golang. Forked from davecheney/i2c.
MIT License
178 stars 53 forks source link

undefined: I2C_SLAVE #11

Open heatxsink opened 4 years ago

heatxsink commented 4 years ago

Trying to go get this and ... no dice.

go get -u github.com/d2r2/go-i2c
# github.com/d2r2/go-i2c
../../../../pkg/mod/github.com/d2r2/go-i2c@v0.0.0-20191123181816-73a8a799d6bc/i2c.go:36:26: undefined: I2C_SLAVE
d2r2 commented 4 years ago

Hi @heatxsink. Could you specify what OS you employ? Be aware, that this library works only with Linux systems. No Windows, no FreeBSD...

lukibahr commented 3 years ago

got the same error, running on macOS (darwin)

d2r2 commented 3 years ago

@lukibahr , I'm sorry, macOS (FreeBSD, Windows as well) is not supported. And if you try to compile this code directly on macOS, I assume this is mistake and you should use cross compilation approach, because you don't have intention to run this code on macOS, right?

lukibahr commented 3 years ago

okay, thank you for your hint. Cross compiling the code for UNIX will be enough for me.

d2r2 commented 3 years ago

@lukibahr, I will recommend additionally take a look at these comments, where, as I remember we have discussed same aspect: https://github.com/d2r2/go-dht/issues/11#issuecomment-472924091