gopacket cross-compiling with xgo #65
Comments
I have a similar issue with OpenCV => https://github.com/lazywei/go-opencv/ the dependency can be installed via apt on Debian, linked manually against DLLs on windows, and added via homebrew on OSX. but manually adding the source tarball and all of the underlying dependencies is frankly, a nasty experience. (it also requires cmake to build, so, insert issue with adding deps that require cmake). I suppose a simple way to address this might be to either modify my xgo docker image manually and doing and installing the library, (of course this would create problems when compiling multi platform without careful design). Or perhaps adding the ability to run a set of commands before the compile process starts ( as suggested in another issue i believe). But ultimately I am unsure of what would be the "best" approach to adding this functionality idiomatically to the xgo project. |
Hi, thank you for response, 2016-11-16 23:01 GMT+02:00 vyrus001 notifications@github.com:
|
Hi @SergiiShapoval, i am facing the same problem becoz the xgo container is missing the pcap.h.
i try to build the image be specifying the
but it gives another error
actually i just need to build my project for linux. how could u make the the gopacket works for linux build? |
Hi @ykyuen, |
Hi @SergiiShapoval, Thanks for your quick reply. i couldn't get the build work for linux because the pcap.h is missing in the xgo-base image. Currently i forked the repository and install the libpcap package. but this only works for
|
@ykyuen we are using linux/amd64, haven't tried others... |
@SergiiShapoval |
Any news about including libpcap? Tried ykyuen fork and it worked! |
Same problem as @ykyuen:
Any update? |
@evilsocket did you try @ykyuen fork https://github.com/ykyuen/xgo ? With his fork I was able to cross compile for mips64 ./xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz --depsargs=--with-pcap=linux --targets=linux/mips64 github.com/google/gopacket |
OMG will try ASAP, thanks so much! |
i cant do this ,i tried cross compile my project which used the gopacket to windows ,command like this xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=https://www.winpcap.org/install/bin/WpcapSrc_4_1_3.zip --depsargs=--with-pcap=windows --targets=windows/* ./tProejct of course i forked the ykyuen but it turns out no such file pcap.h , its that ok to use .zip and is it ok to change 'with-pcap=linux' to 'windows' i dont know ,someone give me a hand plz :( |
Hi,
I am using https://godoc.org/github.com/google/gopacket that depends on libpcap-devel library.
How can I pass this dependency to xgo container with deps tag?
I wasn't able to find tar for libpcap-devel only rpm - https://www.rpmfind.net/linux/rpm2html/search.php?query=libpcap
For windows artifact, I guess, I will need to pass another library (Winpcap). Am I right?
The text was updated successfully, but these errors were encountered: