Gandem / bonjour-reflector

A reflector that forwards mdns packets between VLANs - like avahi-reflector but with fine-grained control !
MIT License
177 stars 37 forks source link

go build errors #27

Closed carver7 closed 5 years ago

carver7 commented 5 years ago

I get these errors when trying to run 'go build':

~/go/src/bonjour-reflector $ go build bonjour-reflector/vendor/github.com/google/gopacket/pcap vendor/github.com/google/gopacket/pcap/pcap.go:202:7: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:482:13: identifier "_Ctype_struct_pcap_stat" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:527:49: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:550:10: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:583:41: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:655:66: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:668:19: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:795:34: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo vendor/github.com/google/gopacket/pcap/pcap.go:798:56: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo

This may be due to my being a newcomer to GO, so in case this rules in/out user error: 1.) Installed and configured vlans & network switch & router firewall rules using this tutorial: https://www.sbprojects.net/projects/raspberrypi/vlan.php Verified desired vlan connections by: hostname -I

2.) Installed GO Raspberry Pi 3B running Stretch: $mkdir -p $HOME/go/src $HOME/go/bin $ InstallFile='go1.12.9.linux-armv6l.tar.gz' $ wget https://dl.google.com/go/$InstallFile $ sudo tar -C /usr/local -xvf $InstallFile $ echo 'export GOPATH=$HOME/go' >> ~/.profile $ echo 'export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin' >> ~/.profile $ source ~/.profile

3.) Create, build & run, and install & run test GO program: $ mkdir ~/go/src/hellotest && vi ~/go/src/hellotest/hello.go hello.go contents: package main `import "fmt"` func main() { fmt.Printf("hello, world, Version 2\n") } Build and run: $ cd ~/go/src/hellotest $ go build $ ./hellotest hello, world Version 2 Install and run: $ cd ~/go/src/hellotest $ go install $ cd ~ $ hellotest hello, world Version 2

4.) Install git & dep & libpcap-dev $ sudo apt-get update && sudo apt-get install git -y $ wget https://raw.githubusercontent.com/golang/dep/master/install.sh $ chmod 755 install.sh $ ./install.sh # (no error msgs) $ ln -s $HOME/go/bin/dep /usr/bin/ $ \ls -1 ~/go/bin dep hellov2 $ sudo apt-get install libpcap-dev -y $ cd ~/go/src $ git clone https://github.com/Gandem/bonjour-reflector.git $ cd ~/go/src/bonjour-reflector # CONFIGURED config.toml $ vi config.toml $ dep ensure # (no error msgs) $ go build

Then got the error messages at beginning of this issue/post and no generated file called ~/go/src/bonjour-reflector/bonjour-reflector

Gandem commented 5 years ago

Hey :wave:

Thank you for the detailed issue report, this should be fixed now. If not, please feel free to reopen the issue :slightly_smiling_face: