This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to build wireshark 2.x on Redhat/Centos

0

Hi,

I am trying to build wireshark 2.2.5 on centos 6.8.

I am getting the following errors, any help would be greatly appreciated.

When I execute "make" I get:

[  2%] Built target wsutil
Unable to open /home/c.wiggum/wireshark/wireshark/.svn/entries
version.h unchanged.
[  2%] Built target version
[ 50%] Built target dissectors
[ 50%] Built target lemon
[ 51%] Built target dfilter
[ 51%] Built target crypt
[ 51%] Built target dissectors-corba
[ 52%] Built target ftypes
[ 52%] Built target nghttp2
[ 53%] Built target wmem
[ 53%] Generating ascend.c
/usr/bin/yacc: e - line 4 of "/home/c.wiggum/wireshark/wireshark/wiretap/ascend.y", syntax error
%pure-parser
^
make[2]: *** [wiretap/ascend.c] Error 1
make[2]: *** Deleting file `wiretap/ascend.c'
make[1]: *** [wiretap/CMakeFiles/wiretap.dir/all] Error 2
make: *** [all] Error 2

I installed byacc from the yum repository.

When I execute "make wireshark" I get:

[  1%] Built target translations
[ 24%] Built target qtui
[ 24%] Building C object caputils/CMakeFiles/caputils.dir/capture-pcap-util.c.o
/home/c.wiggum/wireshark/wireshark/caputils/capture-pcap-util.c:614:1: error: static declaration of ‘pcap_datalink_name_to_val’ follows non-static declaration
 pcap_datalink_name_to_val(const char *name)
 ^
In file included from /usr/local/include/pcap.h:43:0,
                 from /home/c.wiggum/wireshark/wireshark/caputils/capture-pcap-util.h:32,
                 from /home/c.wiggum/wireshark/wireshark/caputils/capture-pcap-util.c:76:
/usr/local/include/pcap/pcap.h:405:14: note: previous declaration of ‘pcap_datalink_name_to_val’ was here
 PCAP_API int pcap_datalink_name_to_val(const char *);
              ^
/home/c.wiggum/wireshark/wireshark/caputils/capture-pcap-util.c:629:1: error: static declaration of ‘pcap_datalink_val_to_name’ follows non-static declaration
 pcap_datalink_val_to_name(int dlt)
 ^
In file included from /usr/local/include/pcap.h:43:0,
                 from /home/c.wiggum/wireshark/wireshark/caputils/capture-pcap-util.h:32,
                 from /home/c.wiggum/wireshark/wireshark/caputils/capture-pcap-util.c:76:
/usr/local/include/pcap/pcap.h:406:22: note: previous declaration of ‘pcap_datalink_val_to_name’ was here
 PCAP_API const char *pcap_datalink_val_to_name(int);
                      ^
make[3]: *** [caputils/CMakeFiles/caputils.dir/capture-pcap-util.c.o] Error 1
make[2]: *** [caputils/CMakeFiles/caputils.dir/all] Error 2
make[1]: *** [CMakeFiles/wireshark.dir/rule] Error 2
make: *** [wireshark] Error 2

I download libpcap from tcpdump.org and compiled and installed libpcap.

Below is the output from cmake:

-- Generating build using CMake 3.7.0-rc2
-- No custom file found in /home/c.wiggum/wireshark/wireshark
-- Configuration types: 
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O2 -g -DNDEBUG
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O2 -g -DNDEBUG
-- V: 2.2.5, MaV: 2, MiV: 2, PL: 5, EV: .
-- Found PythonInterp: /usr/bin/python (found version "2.6.6") 
-- Checking for c-compiler flag: -Wall
-- Checking for c-compiler flag: -Wextra
-- Checking for c-compiler flag: -Wendif-labels
-- Checking for c-compiler flag: -Wpointer-arith
-- Checking for c-compiler flag: -Wformat-security
-- Checking for c-compiler flag: -fwrapv
-- Checking for c-compiler flag: -fno-strict-overflow
-- Checking for c-compiler flag: -Wvla
-- Checking for c-compiler flag: -Waddress
-- Checking for c-compiler flag: -Wattributes
-- Checking for c-compiler flag: -Wdiv-by-zero
-- Checking for c-compiler flag: -Wignored-qualifiers
-- Checking for c-compiler flag: -Wpragmas
-- Checking for c-compiler flag: -Wno-overlength-strings
-- Checking for c-compiler flag: -Wno-long-long
-- Checking for c-compiler flag: -Wheader-guard
-- Checking for c-compiler flag: -fexcess-precision=fast
-- Checking for c-compiler flag: -Wc++-compat
-- Checking for c-compiler flag: -Wdeclaration-after-statement
-- Checking for c-compiler flag: -Wshadow
-- Checking for c-compiler flag: -Wno-pointer-sign
-- Checking for c-compiler flag: -Wold-style-definition
-- Checking for c-compiler flag: -Wstrict-prototypes
-- Checking for c-compiler flag: -Wlogical-op
-- Checking for c-compiler flag: -Wjump-misses-init
-- Checking for c-compiler flag: -Wunused-const-variable
-- Checking for c-compiler flag: -Wshorten-64-to-32
-- Checking for c-compiler flag: -Wc99-extensions
-- Checking for c++-compiler flag: -Wall
-- Checking for c++-compiler flag: -Wextra
-- Checking for c++-compiler flag: -Wendif-labels
-- Checking for c++-compiler flag: -Wpointer-arith
-- Checking for c++-compiler flag: -Wformat-security
-- Checking for c++-compiler flag: -fwrapv
-- Checking for c++-compiler flag: -fno-strict-overflow
-- Checking for c++-compiler flag: -Wvla
-- Checking for c++-compiler flag: -Waddress
-- Checking for c++-compiler flag: -Wattributes
-- Checking for c++-compiler flag: -Wdiv-by-zero
-- Checking for c++-compiler flag: -Wignored-qualifiers
-- Checking for c++-compiler flag: -Wpragmas
-- Checking for c++-compiler flag: -Wno-overlength-strings
-- Checking for c++-compiler flag: -Wno-long-long
-- Checking for c++-compiler flag: -Wheader-guard
-- Checking for c++-compiler flag: -fexcess-precision=fast
-- Packagelist: CAP;CARES;GCRYPT;GEOIP;GLIB2;GMODULE2;GNUTLS;GTHREAD2;GTK3;Gettext;Git;KERBEROS;LEX;LIBSSH;LUA;M;NL;PCAP;POD;PORTAUDIO;Perl;PythonInterp;Qt5Core;Qt5LinguistTools;Qt5Multimedia;Qt5PrintSupport;Qt5Svg;Qt5Widgets;SBC;SED;SETCAP;SH;SMI;YACC;YAPP;ZLIB
-- Checking for one of the modules 'libcap'
-- Could NOT find CAP (missing:  CAP_LIBRARY CAP_INCLUDE_DIR) 
-- CAP NOT FOUND
-- Could NOT find CARES (missing:  CARES_LIBRARY CARES_INCLUDE_DIR) 
-- CARES NOT FOUND
-- Could NOT find GCRYPT (missing:  GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR) (Required is at least version "1.4.2")
-- GCRYPT NOT FOUND
-- Checking for one of the modules 'geoip'
-- Could NOT find GEOIP (missing:  GEOIP_LIBRARY GEOIP_INCLUDE_DIR) 
-- GEOIP NOT FOUND
-- GLIB2 FOUND
-- GLIB2 includes: /usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- GLIB2 libs: /usr/lib64/libglib-2.0.so
-- GMODULE2 FOUND
-- GMODULE2 includes: /usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- GMODULE2 libs: gmodule-2.0;rt;glib-2.0
-- Checking for one of the modules 'gnutls'
-- Could NOT find GNUTLS: Found unsuitable version "", but required is at least "2.12.0" (found GNUTLS_LIBRARY-NOTFOUND)
-- GNUTLS NOT FOUND
-- GTHREAD2 FOUND
-- GTHREAD2 includes: /usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- GTHREAD2 libs: gthread-2.0;rt;glib-2.0
-- Could NOT find GTK3 (missing:  GTK3_LIBRARY GTK3_INCLUDE_DIR) 
-- GTK3 NOT FOUND
-- GETTEXT FOUND
-- Gettext includes: 
-- Gettext libs: 
-- Git FOUND
-- Git includes: 
-- Git libs: 
-- Checking for one of the modules 'krb5;mit-krb5;heimdal-krb5'
-- Could NOT find KERBEROS (missing:  KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR) 
-- KERBEROS NOT FOUND
-- LEX FOUND
-- LEX includes: 
-- LEX libs: 
-- LEX executable: /usr/bin/flex
-- Could NOT find LIBSSH (missing:  LIBSSH_LIBRARIES LIBSSH_INCLUDE_DIRS LIBSSH_VERSION) (Required is at least version "0.6")
-- LIBSSH NOT FOUND
-- Checking for one of the modules 'lua5.2;lua-5.2;lua52;lua5.1;lua-5.1;lua51;lua5.0;lua-5.0;lua50'
-- Checking for one of the modules 'lua<=5.2.99'
-- Could NOT find LUA (missing:  LUA_LIBRARY LUA_INCLUDE_DIR LUA_VERSION_NUM) 
-- LUA NOT FOUND
-- M FOUND
-- M includes: /usr/include
-- M libs: /usr/lib64/libm.so
-- Checking for modules 'libnl-3.0;libnl-genl-3.0;libnl-route-3.0'
--   No package 'libnl-3.0' found
--   No package 'libnl-genl-3.0' found
--   No package 'libnl-route-3.0' found
-- Checking for one of the modules 'libnl-2.0'
-- Checking for one of the modules 'libnl-1'
-- Could NOT find NL (missing:  NL_LIBRARY NL_INCLUDE_DIR) 
-- NL NOT FOUND
-- PCAP FOUND
-- PCAP includes: /usr/include
-- PCAP libs: /usr/lib64/libpcap.so
-- POD FOUND
-- POD includes: 
-- POD libs: 
-- Checking for one of the modules 'portaudio-2.0'
-- Could NOT find PORTAUDIO (missing:  PORTAUDIO_LIBRARY PORTAUDIO_INCLUDE_DIR) 
-- PORTAUDIO NOT FOUND
-- PERL FOUND
-- Perl includes: 
-- Perl libs: 
-- Perl executable: /usr/bin/perl
-- Found PythonInterp: /usr/bin/python (found suitable version "2.6.6", minimum required is "2") 
-- PYTHONINTERP FOUND
-- PythonInterp includes: 
-- PythonInterp libs: 
-- Qt5Core FOUND
-- Qt5Core includes: /home/c.wiggum/qtInstall/include/;/home/c.wiggum/qtInstall/include/QtCore;/home/c.wiggum/qtInstall/.//mkspecs/linux-g++
-- Qt5Core libs: Qt5::Core
-- Qt5Core definitions: -DQT_CORE_LIB
-- Qt5LinguistTools FOUND
-- Qt5LinguistTools includes: 
-- Qt5LinguistTools libs: 
-- Qt5Multimedia FOUND
-- Qt5Multimedia includes: /home/c.wiggum/qtInstall/include/;/home/c.wiggum/qtInstall/include/QtMultimedia;/home/c.wiggum/qtInstall/include/QtNetwork;/home/c.wiggum/qtInstall/include/QtCore;/home/c.wiggum/qtInstall/.//mkspecs/linux-g++;/home/c.wiggum/qtInstall/include/QtGui;/usr/include
-- Qt5Multimedia libs: Qt5::Multimedia
-- Qt5Multimedia definitions: -DQT_MULTIMEDIA_LIB;-DQT_NETWORK_LIB;-DQT_CORE_LIB;-DQT_GUI_LIB
-- Qt5PrintSupport FOUND
-- Qt5PrintSupport includes: /home/c.wiggum/qtInstall/include/;/home/c.wiggum/qtInstall/include/QtPrintSupport;/home/c.wiggum/qtInstall/include/QtWidgets;/home/c.wiggum/qtInstall/include/QtGui;/home/c.wiggum/qtInstall/include/QtCore;/home/c.wiggum/qtInstall/.//mkspecs/linux-g++;/usr/include
-- Qt5PrintSupport libs: Qt5::PrintSupport
-- Qt5PrintSupport definitions: -DQT_PRINTSUPPORT_LIB;-DQT_WIDGETS_LIB;-DQT_GUI_LIB;-DQT_CORE_LIB
-- Qt5Svg FOUND
-- Qt5Svg includes: /home/c.wiggum/qtInstall/include/;/home/c.wiggum/qtInstall/include/QtSvg;/home/c.wiggum/qtInstall/include/QtWidgets;/home/c.wiggum/qtInstall/include/QtGui;/home/c.wiggum/qtInstall/include/QtCore;/home/c.wiggum/qtInstall/.//mkspecs/linux-g++;/usr/include
-- Qt5Svg libs: Qt5::Svg
-- Qt5Svg definitions: -DQT_SVG_LIB;-DQT_WIDGETS_LIB;-DQT_GUI_LIB;-DQT_CORE_LIB
-- Qt5Widgets FOUND
-- Qt5Widgets includes: /home/c.wiggum/qtInstall/include/;/home/c.wiggum/qtInstall/include/QtWidgets;/home/c.wiggum/qtInstall/include/QtGui;/home/c.wiggum/qtInstall/include/QtCore;/home/c.wiggum/qtInstall/.//mkspecs/linux-g++;/usr/include
-- Qt5Widgets libs: Qt5::Widgets
-- Qt5Widgets definitions: -DQT_WIDGETS_LIB;-DQT_GUI_LIB;-DQT_CORE_LIB
-- Could NOT find SBC (missing:  SBC_INCLUDE_DIR SBC_LIBRARY) 
-- SBC NOT FOUND
-- SED FOUND
-- SED includes: 
-- SED libs: 
-- SED executable: /bin/sed
-- SETCAP FOUND
-- SETCAP includes: 
-- SETCAP libs: 
-- SETCAP executable: /usr/sbin/setcap
-- SH FOUND
-- SH includes: 
-- SH libs: 
-- SH executable: /bin/bash
-- Could NOT find SMI (missing:  SMI_LIBRARY SMI_INCLUDE_DIR) 
-- SMI NOT FOUND
-- YACC FOUND
-- YACC includes: 
-- YACC libs: 
-- YACC executable: /usr/bin/yacc
-- Could NOT find YAPP (missing:  YAPP_EXECUTABLE) 
-- YAPP NOT FOUND
-- ZLIB FOUND
-- ZLIB includes: /usr/include
-- ZLIB libs: /usr/lib64/libz.so
-- Checking for C++ 11 support (Required by Qt 5.7 and later)
-- C-Flags:  -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -fexcess-precision=fast -Wc++-compat -Wdeclaration-after-statement -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init  -fvisibility=hidden
-- CXX-Flags:  -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -fexcess-precision=fast  -std=c++11 
-- Warnings as errors: FALSE
-- Could NOT find LYNX (missing:  LYNX_EXECUTABLE) 
-- Could NOT find ASCIIDOC (missing:  RUNA2X) 
-- No custom file found in /home/c.wiggum/wireshark/wireshark/epan/crypt
-- No custom file found in /home/c.wiggum/wireshark/wireshark/epan/dissectors
-- No custom file found in /home/c.wiggum/wireshark/wireshark/epan/dissectors/asn1
-- Checking for c-compiler flag: -msse4.2
-- docdir: 
-- 
-- The following OPTIONAL packages have been found:
  • GMODULE2
  • Gettext
  • Git
  • PCAP
  • POD
  • PkgConfig
  • Perl
  • Qt5Core
  • Qt5LinguistTools
  • Qt5Network (required version >= 5.7.0)
  • Qt5Gui (required version >= 5.7.0)
  • Qt5Multimedia
  • Qt5PrintSupport
  • Qt5Svg
  • Qt5Widgets
  • SED
  • SETCAP
  • SH
  • ZLIB
  • XSLTPROC
  • PythonInterp

– The following REQUIRED packages have been found:

  • GLIB2
  • GTHREAD2
  • LEX
  • M
  • YACC

– The following OPTIONAL packages have not been found:

  • CAP
  • CARES
  • GCRYPT (required version >= 1.4.2)
  • GEOIP
  • GNUTLS (required version >= 2.12.0)
  • GTK3
  • KERBEROS
  • LIBSSH (required version >= 0.6) , libssh is library for ssh connections and it is needed to build sshdump/ciscodump , <www: https://www.libssh.org/get-it/>
  • LUA
  • NL
  • PORTAUDIO
  • SBC , SBC Codec for Bluetooth A2DP stream playing , <www: http://git.kernel.org/cgit/bluetooth/sbc.git>
  • SMI
  • YAPP
  • LYNX
  • ASCIIDOC

– Configuring done – Generating done

asked 06 Mar ‘17, 13:03

Rob%20B's gravatar image

Rob B
368813
accept rate: 0%


One Answer:

0

Looks like you've got 2 separate issues here. Please split the 2nd issue into another question otherwise this is going to get really confusing.

For the first problem, it appears that the yacc in RHEL/CentOS 6 is too old.

I'm really surprised no one has complained before since there are a number of CentOS 6 users around.

One solution (and probably why there haven't been more complaints): I believe that the source tarballs contain the generated parsers. So if you build from them instead of building from git it should work. You may also have to use automake, etc., rather than cmake.

answered 06 Mar '17, 14:50

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572
accept rate: 27%

I'm really surprised no one has complained before since there are a number of CentOS 6 users around.

There are (at least) two enhanced YACC clones out there - Bison and Berkeley YACC. Current versions of both of them should support %pure-parser. It may be that the Bison in CentOS 6 supports it but the Berkeley YACC doesn't; if so, then, if you have Bison installed, it builds, but if you don't, the configure script and CMake pick (Berkeley) YACC, it doesn't.

Try installing Bison.

(06 Mar '17, 17:44) Guy Harris ♦♦

If I use automake how do I provide the path to qt5? I will give Bison a try. Thanks

(06 Mar '17, 20:17) Rob B

This shouldn't be a CMake vs. autotools issue - if you have Bison installed, CMake should find Bison, just as the autotools configure script would find it, so there should be no need to worry about autotools.

If you want to use autotools, then, unless you've installed Qt5 yourself rather than installing a CentOS package, the configure script should Just Work. If you have installed Qt5 yourself (for example, if CentOS 6 doesn't have a Qt5 package), it'll have to have installed the appropriate pkg-config information for it, otherwise the configure script won't be able to find it - if it has installed it, the configure script should be able to find it without having to tell them where to look.

(06 Mar '17, 21:00) Guy Harris ♦♦

Thanks everyone for the help. Used the source tar ball for 2.2.5 and it compiled nicely. I was even able to add my custom plugin into the build process.

(07 Mar '17, 11:06) Rob B