wireshark編譯
Ⅰ ubuntu下沒有沒有pcap.h頭文件,怎麼辦
今天在ubuntu下進行安裝wireshark,費了很多時間,過程中出了很多錯誤,但最終安裝成功了,這里寫下自己的安裝步驟和方法,供大家參考。
安裝編譯工具:
$sudo apt-get install build-essential
為了成功編譯Wireshark,您需要安裝GTK+的開發文件和GLib庫(libraries)。
$sudo apt-get install libgtk2.0-dev libglib2.0-dev
安裝Checkinstall以便管理您系統中直接由源代碼編譯安裝的軟體。
$sudo apt-get install checkinstall
wireshark源碼 (頁面中的source code)
下載後的文件名:wireshark-1.2.2.tar.bz2
cd到文件目錄解壓:$tar -xvf wireshark-1.2.2.tar.bz2
$cd wireshark-1.2.2
編譯安裝命令如下:
$./configure
$make
$sudo make install
其中make編譯時間會比較長,這樣下來就基本安裝了。
下面是我這篇文章的關鍵,也是用ubuntu安裝的過程中極有可能遇到的問題,且都是在進行./configure編譯過程中出現,兩個問題如下:
---------------------------------------------------------------------------------------------------------
問題1:
view plain to clipboardprint?
./configure執行到最後出錯
checking for perl... /usr/bin/perl
checking for bison... no
checking for byacc... no
checking for yacc... no
configure: error: I couldn't find yacc (or bison or ...); make sure it's installed and in your path
./configure執行到最後出錯
checking for perl... /usr/bin/perl
checking for bison... no
checking for byacc... no
checking for yacc... no
configure: error: I couldn't find yacc (or bison or ...); make sure it's installed and in your path
解決辦法:
view plain to clipboardprint?
sudo apt-get install flex bison
sudo apt-get install flex bison
yacc(Yet Another Compiler Compiler),是Unix/Linux上一個用來生成編譯器的編譯器(編譯器代碼生成器)。
如想深入了解google下。
問題2:
view plain to clipboardprint?
configure: error: Header file pcap.h not found; if you installed libpcap from source, did you also do "make install-incl", and if you installed a binary package of libpcap, is there also a developer's package of libpcap,
and did you also install that package?
configure: error: Header file pcap.h not found; if you installed libpcap from source, did you also do "make install-incl", and if you installed a binary package of libpcap, is there also a developer's package of libpcap,
and did you also install that package?
問題原因是ubuntu下缺少pcap.h等文件。
解決方法:
編譯安裝libpcap.
在www.tcpmp.org頁面中可下載源碼:libpcap-1.0.0.tar.gz
cd到文件目錄:
view plain to clipboardprint?
$tar -xvf libpcap-1.0.0.tar.gz
$cd libpcap-1.0.0.tar.gz
$./configure
$make
$sudo make install
$tar -xvf libpcap-1.0.0.tar.gz
$cd libpcap-1.0.0.tar.gz
$./configure
$make
$sudo make install
----------------------------------------------------------------------------------------------------------------------------------------------------
採用上面的方法後再回到文章前面的步驟:
$cd wireshark-1.2.2編譯安裝:
$./configure
$make
$sudo make install
這樣就安裝好了。
啟動方法:進入wireshark-1.2.2,輸入命令:view plain to clipboardprint?
$sudo ./wireshark
$sudo ./wireshark
這里如果不用sudo,則wireshark找不到網路設備介面,這主要與許可權有關,啟動時注意下就行。
Ⅱ 編譯wireshark怎麼設置qt路徑
Qt默認編譯式態編譯候編寫程序要發布帶態庫文件繁瑣需要靜態編譯程序Qt要實現靜態編譯必須庫文件靜態編譯用命令編譯靜態庫
Ⅲ wireshark怎麼調試
你需要編譯調試版的(默認就是),然後將協議的抓包保存文件用你編譯出來的wireshark.exe打開進行解析。然後將vc調試-附加到進程-wireshark進程。然後點一下這個抓到的包就可以進入斷點了。