I am trying to install pylorcon-1 (the python wrapper for Lorcon used for writing a sniffer for wireless packets) on BACKTRACK 5 R1 Virtual Machine...The package that I downloaded from [Pylorcon Official Page] [1] has 3 files pylorcon.c , setup.py and tx.py.. So as given in the README file I tried to execute the command...
python setup.py build
After Executing the above command I get the following output:
running build
running build_ext
building 'pylorcon' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c pylorcon.c -o build/temp.linux-i686-2.6/pylorcon.o
pylorcon.c:8:20: error: Python.h: No such file or directory
pylorcon.c:9:26: error: structmember.h: No such file or directory
pylorcon.c:10:21: error: tx80211.h: No such file or directory
pylorcon.c:11:28: error: tx80211_packet.h: No such file or directory
pylorcon.c:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:81: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:118: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
pylorcon.c: In function ‘Lorcon_dealloc’:
pylorcon.c:128: warning: implicit declaration of function ‘tx80211_getmode’
pylorcon.c:128: error: ‘Lorcon’ has no member named ‘in_tx’
pylorcon.c:129: warning: implicit declaration of function ‘tx80211_close’
pylorcon.c:129: error: ‘Lorcon’ has no member named ‘in_tx’
pylorcon.c:131: error: ‘Lorcon’ has no member named ‘ob_type’
pylorcon.c:131: error: ‘PyObject’ undeclared (first use in this function)
pylorcon.c:131: error: (Each undeclared identifier is reported only once
pylorcon.c:131: error: for each function it appears in.)
pylorcon.c:131: error: expected expression before ‘)’ token
pylorcon.c: At top level:
pylorcon.c:136: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:151: error: expected declaration specifiers or ‘...’ before ‘PyObject’
pylorcon.c:151: error: expected declaration specifiers or ‘...’ before ‘PyObject’
pylorcon.c: In function ‘Lorcon_init’:
pylorcon.c:152: error: ‘PyObject’ undeclared (first use in this function)
pylorcon.c:152: error: ‘iface’ undeclared (first use in this function)
pylorcon.c:152: error: ‘driver’ undeclared (first use in this function)
pylorcon.c:152: warning: left-hand operand of comma expression has no effect
pylorcon.c:153: error: ‘NULL’ undeclared (first use in this function)
pylorcon.c:155: warning: implicit declaration of function ‘PyArg_ParseTupleAndKeywords’
pylorcon.c:155: error: ‘args’ undeclared (first use in this function)
pylorcon.c:155: error: ‘kwds’ undeclared (first use in this function)
pylorcon.c:161: warning: implicit declaration of function ‘Py_INCREF’
pylorcon.c:162: error: ‘Lorcon’ has no member named ‘iface’
pylorcon.c:162: warning: statement with no effect
pylorcon.c:164: error: ‘Lorcon’ has no member named ‘driver’
pylorcon.c:164: warning: statement with no effect
pylorcon.c:166: error: ‘Lorcon’ has no member named ‘drivertype’
pylorcon.c:166: warning: implicit declaration of function ‘tx80211_resolvecard’
pylorcon.c:166: warning: implicit declaration of function ‘PyString_AsString’
pylorcon.c:166: error: ‘Lorcon’ has no member named ‘driver’
pylorcon.c:166: warning: statement with no effect
pylorcon.c:168: error: ‘Lorcon’ has no member named ‘drivertype’
pylorcon.c:168: error: ‘INJ_NODRIVER’ undeclared (first use in this function)
pylorcon.c:169: warning: implicit declaration of function ‘PyErr_SetString’
pylorcon.c:169: error: ‘LorconError’ undeclared (first use in this function)
pylorcon.c:173: warning: implicit declaration of function ‘tx80211_init’
pylorcon.c:173: error: ‘Lorcon’ has no member named ‘in_tx’
pylorcon.c:173: error: ‘Lorcon’ has no member named ‘iface’
pylorcon.c:174: error: ‘Lorcon’ has no member named ‘drivertype’
pylorcon.c:175: warning: implicit declaration of function ‘tx80211_geterrstr’
pylorcon.c:175: error: ‘Lorcon’ has no member named ‘in_tx’
pylorcon.c:179: warning: implicit declaration of function ‘tx80211_open’
pylorcon.c:179: error: ‘Lorcon’ has no member named ‘in_tx’
pylorcon.c:180: error: ‘Lorcon’ has no member named ‘in_tx’
pylorcon.c:183: warning: implicit declaration of function ‘tx80211_initpacket’
pylorcon.c:183: error: ‘Lorcon’ has no member named ‘in_packet’
pylorcon.c: At top level:
pylorcon.c:191: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:196: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:201: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:269: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:297: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:310: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:327: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:372: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:422: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:455: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:496: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:502: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
pylorcon.c:523: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Lorcon_members’
pylorcon.c:527: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Lorcon_methods’
pylorcon.c:562: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘LorconType’
pylorcon.c:604: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pylorcon_methods’
pylorcon.c: In function ‘initpylorcon’:
pylorcon.c:617: error: ‘PyObject’ undeclared (first use in this function)
pylorcon.c:617: error: ‘m’ undeclared (first use in this function)
pylorcon.c:617: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
pylorcon.c:617: warning: statement with no effect
pylorcon.c:619: warning: implicit declaration of function ‘PyType_Ready’
pylorcon.c:619: error: ‘LorconType’ undeclared (first use in this function)
pylorcon.c:622: warning: implicit declaration of function ‘Py_InitModule3’
pylorcon.c:622: error: ‘pylorcon_methods’ undeclared (first use in this function)
pylorcon.c:623: warning: statement with no effect
pylorcon.c:625: error: ‘NULL’ undeclared (first use in this function)
pylorcon.c:628: error: ‘LorconError’ undeclared (first use in this function)
pylorcon.c:628: warning: implicit declaration of function ‘PyErr_NewException’
pylorcon.c:628: warning: statement with no effect
pylorcon.c:630: warning: implicit declaration of function ‘PyModule_AddObject’
pylorcon.c:633: error: expected expression before ‘)’ token
pylorcon.c:633: error: invalid operands to binary * (have ‘char **’ and ‘char **’)
error: command 'gcc' failed with exit status 1
How can I fix this?
@Ric...i executed the command sudo apt-get install python-dev that you had told me and then again executed the command python setup.py build i got the following output:
running build
running build_ext
building 'pylorcon' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c pylorcon.c -o build/temp.linux-i686-2.6/pylorcon.o
pylorcon.c:10:21: error: tx80211.h: No such file or directory
pylorcon.c:11:28: error: tx80211_packet.h: No such file or directory
pylorcon.c: In function ‘capToList’:
pylorcon.c:20: error: ‘TX80211_CAP_SNIFF’ undeclared (first use in this function)
pylorcon.c:20: error: (Each undeclared identifier is reported only once
pylorcon.c:20: error: for each function it appears in.)
pylorcon.c:23: error: ‘TX80211_CAP_TRANSMIT’ undeclared (first use in this function)
pylorcon.c:26: error: ‘TX80211_CAP_SEQ’ undeclared (first use in this function)
pylorcon.c:29: error: ‘TX80211_CAP_BSSTIME’ undeclared (first use in this function)
pylorcon.c:32: error: ‘TX80211_CAP_FRAG’ undeclared (first use in this function)
pylorcon.c:35: error: ‘TX80211_CAP_CTRL’ undeclared (first use in this function)
pylorcon.c:38: error: ‘TX80211_CAP_DURID’ undeclared (first use in this function)
pylorcon.c:41: error: ‘TX80211_CAP_SNIFFACK’ undeclared (first use in this function)
pylorcon.c:44: error: ‘TX80211_CAP_SELFACK’ undeclared (first use in this function)
pylorcon.c:47: error: ‘TX80211_CAP_TXNOWAIT’ undeclared (first use in this function)
pylorcon.c:50: error: ‘TX80211_CAP_DSSSTX’ undeclared (first use in this function)
pylorcon.c:53: error: ‘TX80211_CAP_OFDMTX’ undeclared (first use in this function)
pylorcon.c:56: error: ‘TX80211_CAP_MIMOTX’ undeclared (first use in this function)
pylorcon.c:59: error: ‘TX80211_CAP_SETRATE’ undeclared (first use in this function)
pylorcon.c:62: error: ‘TX80211_CAP_SETMODULATION’ undeclared (first use in this function)
pylorcon.c:65: error: ‘TX80211_CAP_NONE’ undeclared (first use in this function)
pylorcon.c: In function ‘pylorcon_getversion’:
pylorcon.c:75: warning: implicit declaration of function ‘tx80211_getversion’
pylorcon.c: In function ‘pylorcon_getcardlist’:
pylorcon.c:86: warning: implicit declaration of function ‘tx80211_getcardlist’
pylorcon.c:86: warning: assignment makes pointer from integer without a cast
pylorcon.c:91: error: dereferencing pointer to incomplete type
pylorcon.c:96: error: dereferencing pointer to incomplete type
pylorcon.c:103: error: dereferencing pointer to incomplete type
pylorcon.c:105: error: dereferencing pointer to incomplete type
pylorcon.c:111: warning: implicit declaration of function ‘tx80211_freecardlist’
pylorcon.c: At top level:
pylorcon.c:119: error: field ‘in_tx’ has incomplete type
pylorcon.c:120: error: field ‘in_packet’ has incomplete type
pylorcon.c: In function ‘Lorcon_dealloc’:
pylorcon.c:128: warning: implicit declaration of function ‘tx80211_getmode’
pylorcon.c:129: warning: implicit declaration of function ‘tx80211_close’
pylorcon.c: In function ‘Lorcon_new’:
pylorcon.c:142: error: ‘INJ_NODRIVER’ undeclared (first use in this function)
pylorcon.c: In function ‘Lorcon_init’:
pylorcon.c:166: warning: implicit declaration of function ‘tx80211_resolvecard’
pylorcon.c:168: error: ‘INJ_NODRIVER’ undeclared (first use in this function)
pylorcon.c:173: warning: implicit declaration of function ‘tx80211_init’
pylorcon.c:175: warning: implicit declaration of function ‘tx80211_geterrstr’
pylorcon.c:179: warning: implicit declaration of function ‘tx80211_open’
pylorcon.c:183: warning: implicit declaration of function ‘tx80211_initpacket’
pylorcon.c: In function ‘Lorcon_getmode’:
pylorcon.c:210: error: ‘TX80211_MODE_AUTO’ undeclared (first use in this function)
pylorcon.c:213: error: ‘TX80211_MODE_ADHOC’ undeclared (first use in this function)
pylorcon.c:216: error: ‘TX80211_MODE_INFRA’ undeclared (first use in this function)
pylorcon.c:219: error: ‘TX80211_MODE_MASTER’ undeclared (first use in this function)
pylorcon.c:222: error: ‘TX80211_MODE_REPEAT’ undeclared (first use in this function)
pylorcon.c:225: error: ‘TX80211_MODE_SECOND’ undeclared (first use in this function)
pylorcon.c:228: error: ‘TX80211_MODE_MONITOR’ undeclared (first use in this function)
pylorcon.c: In function ‘Lorcon_setmode’:
pylorcon.c:247: error: ‘TX80211_MODE_AUTO’ undeclared (first use in this function)
pylorcon.c:249: error: ‘TX80211_MODE_ADHOC’ undeclared (first use in this function)
pylorcon.c:251: error: ‘TX80211_MODE_INFRA’ undeclared (first use in this function)
pylorcon.c:253: error: ‘TX80211_MODE_MASTER’ undeclared (first use in this function)
pylorcon.c:255: error: ‘TX80211_MODE_REPEAT’ undeclared (first use in this function)
pylorcon.c:257: error: ‘TX80211_MODE_SECOND’ undeclared (first use in this function)
pylorcon.c:259: error: ‘TX80211_MODE_MONITOR’ undeclared (first use in this function)
pylorcon.c: In function ‘Lorcon_setfunctionalmode’:
pylorcon.c:278: error: ‘TX80211_FUNCMODE_RFMON’ undeclared (first use in this function)
pylorcon.c:280: error: ‘TX80211_FUNCMODE_INJECT’ undeclared (first use in this function)
pylorcon.c:282: error: ‘TX80211_FUNCMODE_INJMON’ undeclared (first use in this function)
pylorcon.c:287: warning: implicit declaration of function ‘tx80211_setfunctionalmode’
pylorcon.c: In function ‘Lorcon_getchannel’:
pylorcon.c:300: warning: implicit declaration of function ‘tx80211_getchannel’
pylorcon.c: In function ‘Lorcon_setchannel’:
pylorcon.c:317: warning: implicit declaration of function ‘tx80211_setchannel’
pylorcon.c: In function ‘Lorcon_gettxrate’:
pylorcon.c:329: warning: implicit declaration of function ‘tx80211_gettxrate’
pylorcon.c:332: error: ‘TX80211_RATE_DEFAULT’ undeclared (first use in this function)
pylorcon.c:335: error: ‘TX80211_RATE_1MB’ undeclared (first use in this function)
pylorcon.c:338: error: ‘TX80211_RATE_2MB’ undeclared (first use in this function)
pylorcon.c:341: error: ‘TX80211_RATE_5_5MB’ undeclared (first use in this function)
pylorcon.c:344: error: ‘TX80211_RATE_6MB’ undeclared (first use in this function)
pylorcon.c:347: error: ‘TX80211_RATE_9MB’ undeclared (first use in this function)
pylorcon.c:350: error: ‘TX80211_RATE_11MB’ undeclared (first use in this function)
pylorcon.c:353: error: ‘TX80211_RATE_24MB’ undeclared (first use in this function)
pylorcon.c:356: error: ‘TX80211_RATE_36MB’ undeclared (first use in this function)
pylorcon.c:359: error: ‘TX80211_RATE_48MB’ undeclared (first use in this function)
pylorcon.c:362: error: ‘TX80211_RATE_108MB’ undeclared (first use in this function)
pylorcon.c: In function ‘Lorcon_settxrate’:
pylorcon.c:376: warning: implicit declaration of function ‘tx80211_getcapabilities’
pylorcon.c:376: error: ‘TX80211_CAP_SETRATE’ undeclared (first use in this function)
pylorcon.c:386: error: ‘TX80211_RATE_DEFAULT’ undeclared (first use in this function)
pylorcon.c:388: error: ‘TX80211_RATE_1MB’ undeclared (first use in this function)
pylorcon.c:390: error: ‘TX80211_RATE_2MB’ undeclared (first use in this function)
pylorcon.c:392: error: ‘TX80211_RATE_5_5MB’ undeclared (first use in this function)
pylorcon.c:394: error: ‘TX80211_RATE_6MB’ undeclared (first use in this function)
pylorcon.c:396: error: ‘TX80211_RATE_9MB’ undeclared (first use in this function)
pylorcon.c:398: error: ‘TX80211_RATE_11MB’ undeclared (first use in this function)
pylorcon.c:400: error: ‘TX80211_RATE_24MB’ undeclared (first use in this function)
pylorcon.c:402: error: ‘TX80211_RATE_36MB’ undeclared (first use in this function)
pylorcon.c:404: error: ‘TX80211_RATE_48MB’ undeclared (first use in this function)
pylorcon.c:406: error: ‘TX80211_RATE_108MB’ undeclared (first use in this function)
pylorcon.c:412: warning: implicit declaration of function ‘tx80211_settxrate’
pylorcon.c: In function ‘Lorcon_getmodulation’:
pylorcon.c:425: warning: implicit declaration of function ‘tx80211_getmodulation’
pylorcon.c:427: error: ‘TX80211_MOD_DEFAULT’ undeclared (first use in this function)
pylorcon.c:430: error: ‘TX80211_MOD_FHSS’ undeclared (first use in this function)
pylorcon.c:433: error: ‘TX80211_MOD_DSSS’ undeclared (first use in this function)
pylorcon.c:436: error: ‘TX80211_MOD_OFDM’ undeclared (first use in this function)
pylorcon.c:439: error: ‘TX80211_MOD_TURBO’ undeclared (first use in this function)
pylorcon.c:442: error: ‘TX80211_MOD_MIMO’ undeclared (first use in this function)
pylorcon.c:445: error: ‘TX80211_MOD_MIMOGF’ undeclared (first use in this function)
pylorcon.c: In function ‘Lorcon_setmodulation’:
pylorcon.c:459: error: ‘TX80211_CAP_SETMODULATION’ undeclared (first use in this function)
pylorcon.c:469: error: ‘TX80211_MOD_DEFAULT’ undeclared (first use in this function)
pylorcon.c:471: error: ‘TX80211_MOD_FHSS’ undeclared (first use in this function)
pylorcon.c:473: error: ‘TX80211_MOD_DSSS’ undeclared (first use in this function)
pylorcon.c:475: error: ‘TX80211_MOD_OFDM’ undeclared (first use in this function)
pylorcon.c:477: error: ‘TX80211_MOD_TURBO’ undeclared (first use in this function)
pylorcon.c:479: error: ‘TX80211_MOD_MIMO’ undeclared (first use in this function)
pylorcon.c:481: error: ‘TX80211_MOD_MIMOGF’ undeclared (first use in this function)
pylorcon.c:487: warning: implicit declaration of function ‘tx80211_setmodulation’
pylorcon.c: In function ‘Lorcon_txpacket’:
pylorcon.c:514: warning: implicit declaration of function ‘tx80211_txpacket’
error: command 'gcc' failed with exit status
locate python2.6
return anything on your system? It seems like the package might be having trouble locating your Python files. In Ubuntu Linux (just a shot in the dark) they are included in a separate packagepython-dev
– user849425