更新时间:2022-04-16 02:22:15
好的,所以我知道了.
为了在Windows上编译gopacket 64bit,您需要执行以下操作:
OK so I have figured it out.
In order to compile gopacket 64bit on windows you need to do the following:
现在的要点是缺少linux静态库文件
(libwpcap.a和libpacket.a)来自lib/x64文件夹.我不知道为什么他们不是
包含在开发人员包中,但无论如何,这就是我们生成它们的方式:
Now the point is that there are missing linux static libraries files
(libwpcap.a and libpacket.a) from lib/x64 folder. I don't know why they weren't
included in the developers pack but anyway that's how we can generate them:
gendef wpcap.dll
和 gendef packet.dll
上运行gendef(可通过MinGW Installation Manager获得,软件包mingw32-gendef) dlltool --as-flags =-64 -m i386:x86-64 -k --output-lib libwpcap.a --input-def wpcap.def
dlltool --as-flags =-64 -m i386:x86-64 -k --output-lib libpacket.a --input-def packet.def
gendef wpcap.dll
and gendef packet.dll
(obtainable with MinGW Installation Manager, package mingw32-gendef)dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libwpcap.a --input-def wpcap.def
dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpacket.a --input-def packet.def
就是这样.
现在gopacket应该可以编译了.
That's it.
Now gopacket should compile with no problems.