Closed qq790382720 closed 1 year ago
You may need to use https://github.com/gopacket/gopacket instead as it looks to be a more up to date version of the gopacket library. In terms of adding the pcap c code, you could use the --deps
argument. Something like --deps=https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2
, but with the pcap code instead.
another possibility is using hooks (-hooksdir
), see also https://github.com/techknowlogick/xgo#hooks then you can install arbitrary pkg in you container (apt install -y libpcap-dev
)
another possibility is using hooks (
-hooksdir
), see also https://github.com/techknowlogick/xgo#hooks then you can install arbitrary pkg in you container (apt install -y libpcap-dev
)
Can you give me an example? Thank you
create a directory, e.g. .xgohooks
in your project's directory. place a file with the name setup.sh
with following content in it:
apt update && apt install -y libpcap-dev
the call xgo with the following option:
xgo -hooksdir .xgohooks ...
@qq790382720 did this work for you? can the issue be closed?
I'll close this now, but please let me know if you need it re-opened :)
Build Command : xgo --targets=linux/arm .
Error: hecking for required docker image techknowlogick/xgo:latest... found. Cross compiling local repository: . : ... Enabled Go module support Building /source/go.mod... Compiling for linux/arm-5... /# github.com/google/gopacket/pcap /go/pkg/mod/github.com/google/gopacket@v1.1.19/pcap/pcap_unix.go:34:18: fatal error: pcap.h: No such file or directory
include
compilation terminated. Cleaning up build environment... Will,What am I supposed to do now