This is our old Q&A Site. Please post any new questions and answers at

The Wireshark development environment needs GTK (which needs Glib, and some others) and Libpcap; however, I cannot find information on the directory-structure dependencies (e.g., directory names, and where the parent directory should be located) and the order of running "configure" for each library.

So: [1] should the support libraries be untar'ed to particular directory names? [2] is there an order sequence to follow in running the configure script within each support library directory structure?

asked 16 Dec '13, 13:39

Tinker's gravatar image

accept rate: 100%

Additional info: This is for an Ubuntu Linux environment.

(16 Dec '13, 13:44) Tinker

Please try this:

apt-get build-dep wireshark

That command will install all packages required to build wireshark from source. After that just run ./configure and make.

See also the developer guide


permanent link

answered 16 Dec '13, 14:11

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
accept rate: 15%

edited 16 Dec '13, 14:16

Yes, I had already completed all those steps, and tried to compile the simplest first example of a dissector, but I get the following error: "In file included from ./epan/packet.h:28:0, from xxxProtocol.c:3: ./wiretap/wtap.h:30:18: fatal error: glib.h: No such file or directory compilation terminated."

This error indicates to me that something is not set up correctly with one of the support libraries (e.g., possibly that I untar'ed glib to the wrong directory). Ideas?

(17 Dec '13, 08:26) Tinker

(e.g., possibly that I untar'ed glib to the wrong directory). Ideas?

there is no need to 'untar' glib anywhere. apt-get build-dep wireshark should install everything you need.

Some questions:

  • what is your Ubuntu version?
  • what is your Wireshark code version?
  • what is the output of: egrep '(GTK|GLIB)' config.status?
(17 Dec '13, 08:30) Kurt Knochner ♦

Ubuntu: 13.04

Wireshark: 1.10.3

egrep results:

    S["GLIBLIBS"]="-pthread -Wl,--export-dynamic -lgthread-2.0 -lgmodule-2.0 -lglib-2.0  "
    S["GLIBCFLAGS"]="-pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include  "
    S["GTKLIBS"]="-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdkpixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobje"\    S["GTKCFLAGS"]="-pthread -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 "\
    D["HAVEGTK"]=" 1"

(17 Dec '13, 09:09) Tinker

I looked over your initial response again, and noticed you did NOT say to run ./ before ./configure. Is needed?

(17 Dec '13, 11:08) Tinker


looks like the right glib has been found. Did you check if glib.h is in that directory on your system?

Ubuntu: 13.04

Did you run configure with the option: --with-gtk3 on Ubuntu 13.04?

./configure --with-gtk3

Then try again.

Is needed?

Based on my experience. No. You can run it to re-generate the make files. However, the source tarball contains everything for ./configure to run and succeed.

The following steps do work on my Ubuntu 13.04, without then need for anything else !?!

apt-get build-deb wireshark
download and unpack wireshark-1.10.3.tgz
./configure --with-gtk3

(18 Dec '13, 03:10) Kurt Knochner ♦

OK, this appears to be getting closer to the detail I need.

First, /usr/include/glib-2.0/glib.h does exist.

Second, no I did not run configure with option "--with-gtk3". However, when I tried that, I now get: " 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.0.0 or later isn't available, so Wireshark can't be compiled "

Additional question, it is apparent that the "apt-get build-dep wireshark" must be run as su, so how many of the other steps need to be executed while su?

(18 Dec '13, 09:47) Tinker

I think running is required if building from a version control working copy. I believe the tarball already has the generated files.

(18 Dec '13, 10:12) grahamb ♦

@grahamb: yes, that's true.

(18 Dec '13, 10:25) Kurt Knochner ♦

how many of the other steps need to be executed while su?


Btw: I just realized, that I have Ubuntu 13.10 not 13.04, but that should not make any difference.

Are you able to compile a plain version of Wireshark, without sample dissector?

(18 Dec '13, 10:26) Kurt Knochner ♦

If I use ./configure WITHOUT any options, and then perform make, then both appear to execute without error and I have a wireshark executable that I can launch.

SO, maybe the obvious problem is that either I have something wrong in the sample dissector, or I'm using the wrong compilation options. I am compiling the dissector with: gcc -c dissectorSample.c -o plugins/dissectorSample.o -pedantic -g -Wall -std=c99 -fpic -I.

I'm guessing something isn't right with that command.

(18 Dec '13, 11:06) Tinker

Did you follow the developers guide how to integrate the sample dissector?

BTW: your compiler options do not include the path to the glib header files.... That's (most certainly) the reason why glib.h is not found.

(18 Dec '13, 11:10) Kurt Knochner ♦

I started with a minor variant on example 9.1 for my dissector. However, I have been using gcc on the command line instead of modifying versions of Makefile, I'm guessing that's the source of my error, and I will work with modifying those files.

Your descriptions and attention to this has been most helpful, and has clarified many issues. THANK YOU!

(18 Dec '13, 11:34) Tinker


Hint: If a supplied answer resolves your question can you please "accept" it by clicking the checkmark icon next to it. This highlights good answers for the benefit of subsequent users with the same or similar questions.

(18 Dec '13, 11:38) Kurt Knochner ♦

Final summary: With Ubuntu, building the Wireshark development environment is much easier than suggested by the README.developer guide. The essential steps are: 1) As "su", perform apt-get build-dep wireshark

2) (All remaining steps can be performed as normal user) 2.1) download ( the Wireshark source code (e.g., wireshark-1.10.3.tar.bz2), and unpack it to a directory

2.2) perform: ./configure

2.3) perform: make

So, no additional downloads of the supporting packages (gtk, glib, plibcap) are needed as the "apt-get build-dep wireshark" handles that, and running is not required.

(18 Dec '13, 13:44) Tinker
showing 5 of 14 show 9 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 16 Dec '13, 13:39

question was seen: 2,832 times

last updated: 18 Dec '13, 13:44

p​o​w​e​r​e​d by O​S​Q​A