I need to build the python-subnettree package on a machine that I do not have root privilege. I downloaded pysubnettree-0.11.tar.gz from
http://www.icir.org/robin/pysubnettree/pysubnettree-0.11.tar.gzand tar -xzvf it.
Now when I tried to run "python setup.py build", it gave me the errors as follows:
running build
running build_py
running build_ext
building '_SubnetTree' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c SubnetTree.cc -o build/temp.linux-i686-2.5/
SubnetTree
.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from SubnetTree.cc:8:
SubnetTree.h:4:20: error: Python.h: No such file or directory
In file included from SubnetTree.cc:8:
SubnetTree.h:21: error: PyObject has not been declared
SubnetTree.h:22: error: PyObject has not been declared
SubnetTree.h:27: error: ISO C++ forbids declaration of PyObject with no type
SubnetTree.h:27: error: expected ; before * token
SubnetTree.h:28: error: ISO C++ forbids declaration of PyObject with no type
SubnetTree.h:28: error: expected ; before * token
SubnetTree.h: In member function bool SubnetTree::operator[](con
st char*) const:
SubnetTree.h:31: error: lookup was not declared in this scope
SubnetTree.h: In member function bool SubnetTree::operator[](lon
g unsigned int) const:
SubnetTree.h:32: error: lookup was not declared in this scope
SubnetTree.cc: At global scope:
SubnetTree.cc:10: error: expected initializer before * token
SubnetTree.cc:61: error: PyObject has not been declared
SubnetTree.cc:72: error: PyObject has not been declared
SubnetTree.cc: In member function bool SubnetTree::insert(long unsigned int, short unsigned int, int*):
SubnetTree.cc:84: error: dummy was not declared in this scope
SubnetTree.cc:86: error: Py_INCREF was not declared in this scope
SubnetTree.cc: In member function bool SubnetTree::remove(long unsigned int, short unsigned int):
SubnetTree.cc:112: error: PyObject was not declared in this scope
SubnetTree.cc:112: error: data was not declared in this scope
SubnetTree.cc:112: error: expected primary-expression before ) token
SubnetTree.cc:112: error: expected `;' before node
SubnetTree.cc:113: error: Py_DECREF was not declared in this scope
SubnetTree.cc:117: error: dummy was not declared in this scope
SubnetTree.cc: At global scope:
SubnetTree.cc:120: error: expected constructor, destructor, or type conversion before * token
SubnetTree.cc:135: error: expected constructor, destructor, or type conversion before * token
error: command 'gcc' failed with exit status 1
Does anyone know how to resolve this error?
Start Free Trial