Wireshark-dev: Re: [Wireshark-dev] Unable to run wireshark, tshark or dumpcap from the build di

From: Stephen Fisher <steve@xxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Oct 2010 16:22:35 -0600
On Fri, Oct 01, 2010 at 06:32:41PM +0000, Christopher Maynard wrote:

> I am unable to run wireshark, tshark or dumpcap from the build Is 
> there something I'm doing wrong here?  Those symbols are all in 
> epan/.libs/libwireshark.so.  My guess is that the binaries are linking 
> against the much older already installed version of wireshark instead 
> of the new one, but how do I fix this?  I thought 
> WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 was supposed to take care of 
> this.  Any ideas?

Do you have a different version installed on the system while you're 
trying to run from the build directory?  I've run into problems in the 
past with that.  The RUN_FROM_BUILD_DIRECTORY logic in epan/filesystem.c 
doesn't seem to have anything to do with dynamic library linking and it 
turns itself on automatically when the executable name has ".libs" at 
the beginning anyway.

FreeBSD has a tool called ldd that links the objects that an executable 
is linked to.  Linux should have a similar program.  What about if you 
run it with "libtool --mode=execute" like below:

sfisher@shadow:/usr/local/src/wireshark>libtool --mode=execute ldd ./tshark
/usr/local/src/wireshark/.libs/tshark:
        libwiretap.so.0 => /usr/local/src/wireshark/wiretap/.libs/libwiretap.so.0 (0x280ba000)
        libwireshark.so.0 => /usr/local/src/wireshark/epan/.libs/libwireshark.so.0 (0x28108000)
        libwsutil.so.0 => /usr/local/src/wireshark/wsutil/.libs/libwsutil.so.0 (0x2a272000)
  <snip>

When I don't run with the wrapper, it finds the installed libraries:

sfisher@shadow:/usr/local/src/wireshark>libtool --mode=execute ldd .libs/tshark 
.libs/tshark:
        libwiretap.so.0 => /usr/local/lib/libwiretap.so.0 (0x280ba000)
        libwireshark.so.0 => /usr/local/lib/libwireshark.so.0 (0x28108000)
        libwsutil.so.0 => /usr/local/lib/libwsutil.so.0 (0x2a272000)
  <snip>