PDA

View Full Version : Problems with compile under ubuntu 7.10



nirnex
01-02-2008, 05:36 PM
Getting the following during my compile on a new Ubuntu install. Been a while since I've been able to get a decent linux box running.

g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/qt3 -I. -DPKGDATADIR=\"/usr/local/share/showeq/\" -I/usr/include/pcap -D_REENTRANT -O2 -Wall -g -ggdb -DDEBUG -finline-functions -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=false -DICON_DIR=\"/eq-icons/\" -g -O2 -MT packetcapture.o -MD -MP -MF .deps/packetcapture.Tpo -c -o packetcapture.o packetcapture.cpp
packetcapture.cpp: In member function ‘void PacketCaptureThread::start(const char*, const char*, bool, uint8_t)’:
packetcapture.cpp:98: error: invalid conversion from ‘const char*’ to ‘char*’
packetcapture.cpp:98: error: initializing argument 1 of ‘int pcap_lookupnet(char*, bpf_u_int32*, bpf_u_int32*, char*)’
packetcapture.cpp: In member function ‘void PacketCaptureThread::setFilter(const char*, const char*, bool, uint8_t, uint16_t, uint16_t)’:
packetcapture.cpp:431: error: invalid conversion from ‘const char*’ to ‘char*’
packetcapture.cpp:431: error: initializing argument 1 of ‘int pcap_lookupnet(char*, bpf_u_int32*, bpf_u_int32*, char*)’
make[2]: *** [packetcapture.o] Error 1
make[2]: Leaving directory `/home/pat/showeq-5.12.0.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pat/showeq-5.12.0.0'
make: *** [all] Error 2

Any ideas on this? I know just enoug c to have an idea of what it's telling me but no idea how to get past it. Thanks for any help.

cann
01-04-2008, 06:47 AM
most likely due to ubuntus crapy pcap, try this and recomplie


sudo nano /usr/include/pcap.h

Change


int pcap_lookupnet(char *, bpf_u_int32 *, bpf_u_int32 *, char *);

To


int pcap_lookupnet(const char *, bpf_u_int32 *, bpf_u_int32 *, char *);

ps : serach is your friend , this has been discussed many times before =)

/cann

nirnex
01-04-2008, 08:38 AM
Thank you for your response, that worked, and apologies as while I did search I just didn't find that solution.

cann
01-07-2008, 02:11 AM
Nice, happy gaming =)

/cann