The iputils package is set of small useful utilities for Linux networking. when I tried to compile it from CentOS 7, it turned out to be lacking some dependencies by default.
sys/capability.h
1 2 3 4 5 6 7 8 9
[someone@22a3354ea99c iputils]$ make cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping.o In file included from ping.c:52:0: ping.h:34:28: fatal error: sys/capability.h: No such file or directory #include <sys/capability.h> ^ compilation terminated. make: *** [ping.o] Error 1
This can be resolved by installing libcap-devel.
1
sudo yum install libcap-devel
idn2.h
1 2 3 4 5 6 7 8
[someone@22a3354ea99c iputils]$ make cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping.o In file included from ping.c:52:0: ping.h:39:18: fatal error: idn2.h: No such file or directory #include <idn2.h> ^ compilation terminated. make: *** [ping.o] Error 1
This can be resolved by installing libidn2-devel.
1
sudo yum install libidn2-devel
nettle/md5.h
1 2 3 4 5 6 7 8 9
[someone@22a3354ea99c iputils]$ make cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping.o cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping_common.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping_common.o cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping6_common.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping6_common.o In file included from ping6_common.c:102:0: iputils_md5dig.h:9:25: fatal error: nettle/md5.h: No such file or directory # include <nettle/md5.h> ^ compilation terminated.
This can be resolved by installing nettle-devel.
1
sudo yum install nettle-devel
Using yum provides to find required libraries
One of the most frustrating things about compiling a new library is some library is missing, yum provides can save you a bunch of time. Most often the library that you are missing is packaged in a package named similar to the library. For example, if you miss nettle/md5.h, simply run the script below to check availabilities.
nettle-devel-2.7.1-8.el7.i686 : Development headers for a low-level cryptographic library Repo : base Matched from: Filename : /usr/include/nettle/md5.h
nettle-devel-2.7.1-8.el7.x86_64 : Development headers for a low-level cryptographic library Repo : base Matched from: Filename : /usr/include/nettle/md5.h
Pick up the one that suit your case and it should be working, otherwise, goole it.