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 |
One Answer:
Please try this:
That command will install all packages required to build wireshark from source. After that just run ./configure and make. See also the developer guide Regards answered 16 Dec '13, 14:11 Kurt Knochner ♦ 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
there is no need to 'untar' glib anywhere. Some questions:
(17 Dec '13, 08:30) Kurt Knochner ♦ Ubuntu: 13.04 Wireshark: 1.10.3 egrep results:
(17 Dec '13, 09:09) Tinker I looked over your initial response again, and noticed you did NOT say to run ./autogen.sh before ./configure. Is autogen.sh 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?
Did you run configure with the option: --with-gtk3 on Ubuntu 13.04?
Then try again.
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 !?!
(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 autogen.sh 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 ♦
None 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, et.al. 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 Good. 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 (http://www.wireshark.org/download.html) 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 autogen.sh is not required. (18 Dec '13, 13:44) Tinker showing 5 of 14 show 9 more comments |
Additional info: This is for an Ubuntu Linux environment.