windows 为 python 2.7 编译 libdnet
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7817926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
compile libdnet for python 2.7
提问by Fruch
I'm trying to use scapy on win32 python2.7
我正在尝试在 win32 python2.7 上使用 scapy
I've manage to compile all the other dependencies expect this one
我已经设法编译除了这个之外的所有其他依赖项
can some help in the goal of reaching this executable ? "dnet-1.12.win32-py2.7.exe"
可以帮助实现这个可执行文件的目标吗?“dnet-1.12.win32-py2.7.exe”
(I promise to update the this question too and the scapy manual,
(我保证也会更新这个问题和 scapy 手册,
Running Scapy on Windows with Python 2.7)
使用 Python 2.7 在 Windows 上运行 Scapy)
Update:
更新:
I've managed to compile it with mingw32 I'm using vs2005, and I have to make some fixes to libdnet to actually work (look like last time they compiled it on windows it was with vs6.0
我已经设法用 mingw32 编译它我正在使用 vs2005,我必须对 libdnet 进行一些修复才能实际工作(看起来他们上次在 Windows 上编译它时使用的是 vs6.0
I'll try updating scapy manual... (and upload the executables to there)
我会尝试更新 scapy 手册......(并将可执行文件上传到那里)
采纳答案by naeg
Did you read the README file? Download the source tarball from http://prdownloads.sourceforge.net/libdnet/libdnet-1.11.tar.gz?download, extract it and see README:
你读过自述文件吗?从http://prdownloads.sourceforge.net/libdnet/libdnet-1.11.tar.gz?download下载源 tarball ,解压并查看 README:
Windows 2000/XP
---------------
For raw Ethernet sending, install the WinPcap driver and DLLs, and
extract their developer pack to a build directory:
http://winpcap.polito.it/install/default.htm
# XXX - unsupported for now
# For tunnel interface support, install the OpenVPN "TAP-Win32 Virtual
# Ethernet Adapter" component (their Windows installer will let you
# install it alone):
#
# http://openvpn.sourceforge.net/
For firewall support, install HSC's PktFilter service:
http://www.hsc.fr/ressources/outils/pktfilter/index.html.en
Most Windows developers should just use the libdnet developer's pack
(with MinGW and MSVC++ libraries) instead of building it themselves.
But for those who really want to know...
To build a MinGW native library (under Cygwin+MinGW):
./configure && make
To build a Microsoft Visual C++ native library and Python module
(again, under Cygwin+MinGW):
./configure
cd python && C:/Python23/python.exe setup.py build
cd ../src && lib /out:dnet.lib *.obj
As you most likely noticed you will need Cygwin+MinGW. I don't know whether you want the MinGW native lib or the Microsoft Visual C++ native lib. Also note that you have to use the C:/Python27/python.exe to build it.
正如您最有可能注意到的那样,您将需要 Cygwin+MinGW。我不知道你是想要 MinGW 原生库还是 Microsoft Visual C++ 原生库。另请注意,您必须使用 C:/Python27/python.exe 来构建它。
If you try this, you can come up with a concrete problem I guess, which you most likely, but not 100% necessarly, better put into a new question and might better ask the mailing list of libdnet if you have compilation problems.
如果你尝试这个,你可以想出一个具体的问题,我猜你最有可能,但不是 100% 必须,最好提出一个新问题,如果你有编译问题,最好询问 libdnet 的邮件列表。
回答by desolat
Dirk Loss provides an Windows installer for the dnet package for Python 2.7. Together with the Windows installer for the pypcap package for Python 2.7I was able to run Scapy successfully on Python 2.7 on Windows.
Dirk Loss为 Python 2.7 的 dnet 包提供了一个Windows 安装程序。与Python 2.7 的 pypcap 包的Windows 安装程序一起,我能够在 Windows 上的 Python 2.7 上成功运行 Scapy。