LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Fail to compile Wireshark (https://www.linuxquestions.org/questions/slackware-14/fail-to-compile-wireshark-4175510119/)

1337_powerslacker 07-04-2014 10:35 AM

Fail to compile Wireshark
 
I am attempting to compile Wireshark (1.10.8), and keep getting an error relating (supposedly) to a missing library:

Code:

checking for GTK+ - version >= 2.12.0 and < 3.0... Package libpng14 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng14.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpng14', required by 'GdkPixbuf', not found
no
*** 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: Neither Qt nor GTK+ 2.12.0 or later are available, so Wireshark can't be compiled

I have checked my version of libpng, and it is 1.6.12.

A quick listing of the /usr/lib64 directory for libpng reveals this:
Code:

root@slacker:/home/mattallmill/Downloads/SlackBuilds/wireshark ] # ls /usr/lib64/libpng
libpng.a            libpng.so.3.50.0    libpng12.so.0.50.0  libpng16.la
libpng.la            libpng12.a          libpng14.so.14      libpng16.so
libpng.so            libpng12.la          libpng14.so.14.12.0  libpng16.so.16
libpng.so.14        libpng12.so          libpng15.so.15      libpng16.so.16.12.0
libpng.so.3          libpng12.so.0        libpng16.a

Part of the error message indicates I should add the directory containing libpng14.pc to the PKG_CONFIG_PATH environment variable, so I did a find command from the / directory to locate this file, like so:

Code:

find . |grep libpng14.pc
And it revealed:

Code:

/usr/lib/pkgconfig/libpng14.pc
But when I added the directory to the PKG_CONFIG_PATH variable, like so:

Code:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH::/usr/lib/pkgconfig/
and rerun the SlackBuild, the same error occurs. As for Qt and GTK, both packages are installed, as I am running KDE.

Any help would be greatly appreciated.

coralfang 07-04-2014 11:05 AM

You might need to check your architecture:
Quote:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH::/usr/lib64/pkgconfig/

1337_powerslacker 07-04-2014 11:29 AM

Quote:

Originally Posted by coralfang (Post 5198633)
You might need to check your architecture:

I thought about that too, and added it to my PKG_CONFIG_PATH. Unfortunately, the same error recurs. Thanks for the suggestion anyway.

coralfang 07-04-2014 11:41 AM

Well, i just tried to build wireshark 1.10.7 from slackbuilds.org (the version they have), and it compiles successfully. Maybe look at the build options in the slackbuild;

http://slackbuilds.org/slackbuilds/1...ork/wireshark/

You could always change the version part:
Code:

VERSION=${VERSION:-1.10.7}
And attempt to build a package with the 1.10.8 source tarball.

1337_powerslacker 07-04-2014 12:22 PM

Quote:

Originally Posted by coralfang (Post 5198658)
Well, i just tried to build wireshark 1.10.7 from slackbuilds.org (the version they have), and it compiles successfully. Maybe look at the build options in the slackbuild;

http://slackbuilds.org/slackbuilds/1...ork/wireshark/

You could always change the version part:
Code:

VERSION=${VERSION:-1.10.7}
And attempt to build a package with the 1.10.8 source tarball.

I'll do that. Thanks for the help.

qunying 07-04-2014 12:49 PM

My compilation went fine. I commented out the two patch line. And also remove the old wireshark package before compiling.

#patch -p1 < $CWD/configure.in.patch
#sed -i "s|/lib)|/lib$LIBDIRSUFFIX)|g" configure.in

1337_powerslacker 07-04-2014 01:39 PM

Quote:

Originally Posted by coralfang (Post 5198658)
Well, i just tried to build wireshark 1.10.7 from slackbuilds.org (the version they have), and it compiles successfully. Maybe look at the build options in the slackbuild;

http://slackbuilds.org/slackbuilds/1...ork/wireshark/

You could always change the version part:
Code:

VERSION=${VERSION:-1.10.7}
And attempt to build a package with the 1.10.8 source tarball.

Silly me forgot to check the contents of /usr/lib64/pkgconfig before running the SlackBuild. The directory only had libpng12.pc and libpng16.pc. Going on the premise that newer versions of files would contain the needed function(s) of libpng14.pc, I soft-linked libpng16.pc to libpng14.pc, as follows:

Code:

[mattallmill@slacker:/usr/lib64/pkgconfig ] $ ls -lha libpng14.pc
lrwxrwxrwx 1 root root 11 Jul  4 12:49 libpng14.pc -> libpng16.pc

Combined with the earlier advice to check my architecture (I am indeed running x86_64), I again ran the SlackBuild. Now compilation completes successfully.

To recap for those having similar issues compiling Wireshark on -current:

Create a link to libpng14.pc in /usr/lib64/pkgconfig:
Code:

ln -s libpng16.pc libpng14.pc
Add the path for libpng14.pc to /usr/lib or /usr/lib64, according to architecture, as follows:

Code:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH::/usr/lib{64}/pkgconfig
Link to libpng14.la and libpng14.so as follows from the /usr/lib{64} directory:

Code:

ln -s libpng16.la libpng14.la
ln -s libpng16.so libpng14.so

Compilation should then complete successfully.


All times are GMT -5. The time now is 12:31 AM.