簡體   English   中英

golang錯誤:引用未定義的標識符'syscall.TUNSETIFF'

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

因此,我一直在嘗試使用gccgo構建法蘭絨( 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。 誰能幫我弄清楚這里到底是什么問題? TIA

因此,我找到了答案。 問題是gccgo沒有為我的拱門定義TUNSETIFF。 我相應地定義了值,並且能夠使它起作用。 謝謝@JimB

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM