gopacket: gopacket linux undefined: pcapErrorNotActivated . Windows has no problem
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
`package main
import ( “fmt”
"github.com/google/gopacket/pcap"
)
func main() { fmt.Println(pcap.Version()) }`
Already installed libpcap and c test available What is the reason?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16
I fixed this issue by setting
CGO_ENABLED=1
.