Several days ago, I write a program to Sniffer on the network. And I used the libpcap to capture the packets. The program is under the console,so when I compile the program, I just write:
g++ -o myprogram myprogram.cpp -L/usr/local/libpcap-0.9.4 -lpcap -lnet -lpthread
Beacuse I used the libpcap,libnet,pthread, so I wrote -lpcap,-lnet,-lpthread. And my libpcap is in the /usr/local,so I wrote -L/usr/local/libpcap-0.9.4, then I compile it successfully.
But now, I want the program to be visualization, and I want to use Qt/KDE to finish it. So I use the "Qt Designer", but the problem appears, that is where should I write the scentence:
"-L/usr/local/libpcap-0.9.4 -lpcap -lnet -lpthread".
The method to compile the Qt program is:
First, make a new file named "main.cpp", then type the scentence below in the console to make a Makefile:
qmake -o Makefile myprogram.pro
Now type the "make" in the console to compile. At last type ./myprogram, the program should run successfully.
If the program is a simple one,the method above is OK,but I must use -lpcap,-lbnet,lpthread, and I don't know where to write it.
So some functions in the libpcap and libnet and so on is can't be compiled.
Could somebody tell me how to solve the problem?