Wireshark-dev: Re: [Wireshark-dev] How to compile and execute the source code of wireshark?
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 18 Jun 2015 10:13:52 -0700
On Jun 18, 2015, at 7:17 AM, JAI BHAGWAN YADAV <saurav.yadav0005@xxxxxxxxx> wrote:

> Hello all,
> I am a beginner,
> Q- How to compile and execute the source code of wireshark so that
>      (i) Whenever I will compile and execute it, it will also run wireshark

You succeeded in doing that.

>      (ii) I will use printf firstly so I can see the output at terminal
> 
> O.S. used: 64 bit, Ubuntu 12.04
> What I tried?
> I have tried ./autogen.sh It run successfully.

OK, that's what we'd expect to happen.

> then ./configure It also run successfully, takes 2 minutes to execute on my system (1 GB RAM, virtual machine).

OK, that's what we'd expect to happen; there are a lot of tests to perform, so it will take a while to run.

> then make It also run successfully, takes 15-20 approx minutes to execute.

OK, that's what we'd expect to happen; there's a lot of Wireshark source code, so it will take a while to run.  If the host of your VM is a multi-core/multiprocessor machine, and the VM is configured to support more than one core, you might want to use the "-j" flag to run compilations in parallel; I do my compiles on a 4-core MacBook Pro, with two-way multithreading on each core, and "make -j 8" makes the compilation run a *lot* faster.

> Only warnings can be seen in between of these execution but no error occured.

OK, that's what we'd expect to happen.

> But also no wireshark window get opened,

And so is that!  "make" *compiles* a program, it doesn't run it, and it's not *supposed* to run it.

> it will only open when I execute the command ./wireshark. So, please tell me the correct way and order to write all the commands.

The correct way to write the commands is:

	./autogen.sh - but only if this is the first time you build after checking the source code out from Git; if you make a change to Wireshark source after that, you shouldn't need to run autogen.sh again

	./configure - but only if this is the first time you build after checking the source code out from Git; if you make a change to Wireshark source after that, you shouldn't need to run configure again

	make

	./wireshark

Yes, all four commands.  If you want wireshark to *run*, you need that fourth command.  *That's* the command for the "execute" step in "compile and execute the source code of wireshark" (or, rather, execute the *binary* code produced by compiling the source code).