helpsystems / pcapy

Pcapy is a Python extension module that interfaces with the libpcap packet capture library.
Other
382 stars 106 forks source link

Error when compiling master: pcapobj.cc:652:11: error: no member named 'ob_type' in 'pcapobject' #36

Open jab1982 opened 7 years ago

jab1982 commented 7 years ago

I have just cloned pcapy and I am getting the following error when trying to compile it:

(python36) $ python setup.py build

my_init_posix: changing LDSHARED = 'clang++ -bundle -undefined dynamic_lookup'
to 'clang++ -bundle -undefined dynamic_lookup'
running build
running build_ext
building 'pcapy' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pcapdumper.cc -o build/temp.macosx-10.12-x86_64-3.6/pcapdumper.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c bpfobj.cc -o build/temp.macosx-10.12-x86_64-3.6/bpfobj.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pcapobj.cc -o build/temp.macosx-10.12-x86_64-3.6/pcapobj.o
pcapobj.cc:652:11: error: no member named 'ob_type' in 'pcapobject'
  if (pp->ob_type != &Pcaptype)
      ~~  ^
1 error generated.
error: command 'clang' failed with exit status 1

$ python -V Python 3.6.1

Mac OS X Sierra(10.12.6).

Any clue?

Noxet commented 6 years ago

Have the same issue:

pcapobj.cc:652:11: error: ‘struct pcapobject’ has no member named ‘ob_type’; did you mean ‘ob_base’?
   if (pp->ob_type != &Pcaptype)
           ^~~~~~~
           ob_base
error: command 'gcc' failed with exit status 1

Running Python 3.6.2 and GCC 7.1.1