golang错误:对未定义的标识符’syscall.TUNSETIFF’的引用。

huangapple go评论81阅读模式
英文:

golang error: reference to undefined identifier ‘syscall.TUNSETIFF’

问题

所以,我一直在尝试使用gccgo构建flannel(https://github.com/coreos/flannel)。在构建过程中,我遇到了以下错误:

$ ./build
Building flanneld...
# github.com/coreos/flannel/pkg/ip
gopath/src/github.com/coreos/flannel/pkg/ip/tun.go:57:37: error: reference to undefined identifier ‘syscall.TUNSETIFF’
  err = ioctl(int(tun.Fd()), syscall.TUNSETIFF, uintptr(unsafe.Pointer(&ifr)))
                                     ^

我正在使用gccgo-5和gcc-5。有人能帮我弄清楚这个问题是什么吗?谢谢。

英文:

So, I have been trying to build flannel (https://github.com/coreos/flannel) with gccgo. Here is the error I am getting while building:

$ ./build 
Building flanneld...
# github.com/coreos/flannel/pkg/ip
gopath/src/github.com/coreos/flannel/pkg/ip/tun.go:57:37: error: reference to undefined identifier ‘syscall.TUNSETIFF’
  err = ioctl(int(tun.Fd()), syscall.TUNSETIFF, uintptr(unsafe.Pointer(&ifr)))
                                     ^

I am using gccgo-5 and gcc-5. Can anyone please help me figure out what exactly is the issue here? TIA

答案1

得分: 0

所以,我找到了答案。问题是gccgo没有为我的架构定义TUNSETIFF。我相应地定义了该值,然后就能够使其正常工作了。谢谢@JimB。

英文:

So, I found the answer. The problem was that gccgo didn't define TUNSETIFF for my arch. I defined the value accordingly and I was able to make it work. Thanks @JimB

huangapple
  • 本文由 发表于 2015年7月2日 18:10:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/31181747.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定