Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error building pcapy with mingw32 #40

Open
nazaninIT opened this issue Nov 4, 2017 · 1 comment
Open

error building pcapy with mingw32 #40

nazaninIT opened this issue Nov 4, 2017 · 1 comment

Comments

@nazaninIT
Copy link

nazaninIT commented Nov 4, 2017

Hi. I am using mingw32 and 32 bit python 2.7
-WpdPack is downloaded and used in include and lib dir in setup.py . I changed the Include and Lib directories in setup.py (in pcapy) and they are true.
-I also installed python setuptools
-MinGW and gcc are correctly installed (I compiled many other C++ files with them, and using python)
-I use command python setup.py build_ext -c mingw32 in the folder contains pcapy.
first I had this error :

c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared
using ::hypot;
^~~~~

I added #define hypot _hypot before that line and this error faded away.

now I have this error :

c:\mingw\include\stdio.h:349:12:
In file included from C:\sulley-master\WpdPack\Include/pcap/pcap.h:54:0,
from C:\sulley-master\WpdPack\Include/pcap.h:45,
from bpfobj.cc:10:
c:\mingw\include\stdio.h:345:12: error: expected initializer before '__mingw__snprintf'
extern int mingw_stdio_redirect(snprintf)(char*, size_t, const char*, ...);
c:\mingw\include\stdio.h:349:12: error: expected initializer before '__mingw__vsnprintf'
extern int mingw_stdio_redirect(vsnprintf)(char*, size_t, const char*, __VALIST);
error: command 'C:\MinGW\bin\gcc.exe' failed with exit status 1

I don't know what shall I do with this. please help me.

@ermaoCode
Copy link

ermaoCode commented May 10, 2018

I also have these problems.
And I solved this problem by using pip.

py -2 -m pip install pcapy --global-option=build_ext --global-option="-LD:\files\git_repositories\WpdPack\Lib" --global-option="-ID:\files\git_repositories\WpdPack\Include"

I don't know why but it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants