gopacket ubuntu16.04错误未定义:pcapErrorNotActivated

root @ ubuntu:〜/ processNet / processNet#go testtest.go </ p>

< h1> github.com/google/gopacket/pcap </ h1>

/home/go/src/github.com/google/gopacket/pcap/pcap.go:30:22:未定义:pcapErrorNotActivated

/ home / go / src / github.com / google / gopacket / pcap / pcap.go:52:17:未定义:pcapTPtr
/ home / go / src / github.com / google / gopacket / pcap / pcap .go:64:10:未定义:pcapPkthdr </ p>

  
import(
“ fmt”

“ github.com/google/gopacket/pcap"

func main(){
fmt.Println(pcap.Version())
}```

已经安装了libpcap和c测试可用
</ code> </ pre>
</ DIV>

展开原文

原文

root@ubuntu:~/processNet/processNet# go run testversion.go

github.com/google/gopacket/pcap

/home/go/src/github.com/google/gopacket/pcap/pcap.go:30:22: undefined: pcapErrorNotActivated /home/go/src/github.com/google/gopacket/pcap/pcap.go:52:17: undefined: pcapTPtr /home/go/src/github.com/google/gopacket/pcap/pcap.go:64:10: undefined: pcapPkthdr


import (
        "fmt"

        "github.com/google/gopacket/pcap"
)

func main() {
        fmt.Println(pcap.Version())
}```

Already installed libpcap and c test available

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问