wireshark源码编译

开发环境:

主机:mac pro 

虚拟机:virtural box 5.0.14

编译环境:ubuntu14.04(64位)


1.配置环境

1.1安装virtural box最新版本及增强包

1.2安装ubuntu14.04虚拟机



2.下载源码

https://www.wireshark.org/download/src/all-versions/wireshark-2.0.1.tar.bz2

解压后配置编译

./configure

make 

sudo make install

sudo ./wireshark


3.其实工具安装

3.1安装cmake

sudo apt-get install cmake


异常记录

1.opengl库冲突导致系统无法启动

由于之前系统缺少opengl相关的东西,安装libgl1-mesa-dev 时出现包冲突,删除冲突包导致重启后系统无法启动,于是重装系统并先安装这个库。


2.yacc错误

错误信息:

configure: error: I couldn't find yacc (or bison or ...); make sure it's installed and in your path

解决办法:

sudo apt-get install flex bison


3.Qt错误

错误信息:

configure: error: Need a working C++ compiler to build Wireshark with Qt

解决办法:

sudo apt-get install qt5-default

4.c++错误

错误信息:

configure: error: Need a working C++ compiler to build Wireshark with Qt

解决办法:

sudo apt-get install g++


5.GTK错误

错误信息:

checking for GTK+ - version >= 3.0.0... no

*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: error: GTK+ 3 is not available

解决办法:

sudo apt-get install libgtk-3-dev

6.pcap错误

错误信息:

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?

解决办法:

sudo apt-get install libpcap-dev


7.3d加速

错误信息:

libGL error: pci id for fd 21: 80ee:beef, driver (null)

说明:

虚拟机设置使用3D加速后,部分应用无法启动,例如qtcreator

解决办法:

1.) Add the PPA Repository
  $ sudo add-apt-repository ppa:oibaf/graphics-drivers
2.) Update sources
  $ sudo apt-get update
3.) Dist-upgrade (rebuilds many packages)
  $ sudo apt-get dist-upgrade
4.) Then I rebooted.

注意:

升级系统OPENGL版本,会导致qtcreator找不到gl库,安装libgl1-mesa-dev又会导致包冲突,删除冲突的包会导致系统无法启动,暂时先禁用3D加速。

要安装Wireshark源码,您可以按照以下步骤进行操作: 1. 首先,确保您的系统上已经安装了一些必要的软件包和依赖项,例如编译器、开发工具和库文件。这些依赖项可能因您使用的操作系统而异。对于大多数Linux发行版,可以使用包管理器来安装它们。 2. 接下来,您需要从Wireshark官方网站下载最新的源代码压缩包。您可以访问https://www.wireshark.org/download.html下载页面并选择适合您的操作系统的源代码压缩包。 3. 下载完成后,将压缩包解压到您选择的目录中。 4. 打开终端并导航到解压后的源代码目录。 5. 在终端中运行以下命令来配置Wireshark的构建环境: ``` ./configure ``` 该命令将检查您的系统以确保所有必需的依赖项都已满足,并生成一个Makefile以用于构建。 6. 配置完成后,运行以下命令来编译Wireshark: ``` make ``` 这将使用Makefile来编译源代码,并在完成后生成可执行文件。 7. 最后,运行以下命令以将Wireshark安装到系统中: ``` sudo make install ``` 这将使用管理员权限将Wireshark安装到默认位置。 完成以上步骤后,Wireshark源码就会被编译和安装在您的系统上。您现在可以通过在终端中执行`wireshark`命令来启动Wireshark。请注意,这个过程可能会因操作系统和所使用的版本而有所不同,具体步骤可能会有所调整,请根据您的操作系统和Wireshark版本进行适当的调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值