LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   want to coThe problem when Impile my Qt program,help (https://www.linuxquestions.org/questions/programming-9/want-to-cothe-problem-when-impile-my-qt-program-help-443655/)

zhuqlfeixia 05-10-2006 09:25 PM

want to coThe problem when Impile my Qt program,help
 
Hi,bodies:)
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?
Thanks.

crabboy 05-11-2006 07:50 AM

Continue discussion here:

http://www.linuxquestions.org/questi...37#post2239937


All times are GMT -5. The time now is 04:55 PM.