gpt4 book ai didi

linux - 在 pkg-config 搜索路径中找不到包 xtables

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:37:37 24 4
gpt4 key购买 nike

我已经下载了iproute2。当我制作 ./configure && make && make install 时,我得到了这些错误。

TC schedulers
ATM no
IPT Package xtables was not found in the pkg-config search path.
Perhaps you should add the directory containing `xtables.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xtables' found
using iptables
IPSET yes

iptables modules directory: /lib/xtables
libc has setns: yes
SELinux support: no
ELF support: no
libmnl support: no
Berkeley DB: no

docs: latex: no
WARNING: no docs can be built from LaTeX files
sgml2html: no
WARNING: no HTML docs can be built from SGML

make[1]: Entering directory `/home/mininet/iproute2-4.6.0/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mininet/iproute2-4.6.0/lib'
make[1]: Entering directory `/home/mininet/iproute2-4.6.0/ip'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mininet/iproute2-4.6.0/ip'
make[1]: Entering directory `/home/mininet/iproute2-4.6.0/tc'
gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DCONFIG_GACT -DCONFIG_GACT_PROB -DIPT_LIB_DIR=\"/lib/xtables\" -DYY_NO_INPUT -c -o m_ipt.o m_ipt.c
In file included from m_ipt.c:17:0:
../include/linux/if.h:106:19: error: redeclaration of enumerator ‘IFF_UP’
#define IFF_UP IFF_UP
^
../include/linux/if.h:79:2: note: previous definition of ‘IFF_UP’ was here
IFF_UP = 1<<0, /* sysfs */
^
../include/linux/if.h:107:25: error: redeclaration of enumerator ‘IFF_BROADCAST’
#define IFF_BROADCAST IFF_BROADCAST
^
../include/linux/if.h:80:2: note: previous definition of ‘IFF_BROADCAST’ was here
IFF_BROADCAST = 1<<1, /* __volatile__ */
^
../include/linux/if.h:108:21: error: redeclaration of enumerator ‘IFF_DEBUG’
#define IFF_DEBUG IFF_DEBUG
^
../include/linux/if.h:81:2: note: previous definition of ‘IFF_DEBUG’ was here
IFF_DEBUG = 1<<2, /* sysfs */
^
../include/linux/if.h:109:24: error: redeclaration of enumerator ‘IFF_LOOPBACK’
#define IFF_LOOPBACK IFF_LOOPBACK
^
../include/linux/if.h:82:2: note: previous definition of ‘IFF_LOOPBACK’ was here
IFF_LOOPBACK = 1<<3, /* __volatile__ */
^
../include/linux/if.h:110:27: error: redeclaration of enumerator ‘IFF_POINTOPOINT’
#define IFF_POINTOPOINT IFF_POINTOPOINT
^
../include/linux/if.h:83:2: note: previous definition of ‘IFF_POINTOPOINT’ was here
IFF_POINTOPOINT = 1<<4, /* __volatile__ */
^
../include/linux/if.h:111:26: error: redeclaration of enumerator ‘IFF_NOTRAILERS’
#define IFF_NOTRAILERS IFF_NOTRAILERS
^
../include/linux/if.h:84:2: note: previous definition of ‘IFF_NOTRAILERS’ was here
IFF_NOTRAILERS = 1<<5, /* sysfs */
^
../include/linux/if.h:112:23: error: redeclaration of enumerator ‘IFF_RUNNING’
#define IFF_RUNNING IFF_RUNNING
^
../include/linux/if.h:85:2: note: previous definition of ‘IFF_RUNNING’ was here
IFF_RUNNING = 1<<6, /* __volatile__ */
^
../include/linux/if.h:113:21: error: redeclaration of enumerator ‘IFF_NOARP’
#define IFF_NOARP IFF_NOARP
^
../include/linux/if.h:86:2: note: previous definition of ‘IFF_NOARP’ was here
IFF_NOARP = 1<<7, /* sysfs */
^
../include/linux/if.h:114:23: error: redeclaration of enumerator ‘IFF_PROMISC’
#define IFF_PROMISC IFF_PROMISC
^
../include/linux/if.h:87:2: note: previous definition of ‘IFF_PROMISC’ was here
IFF_PROMISC = 1<<8, /* sysfs */
^
../include/linux/if.h:115:24: error: redeclaration of enumerator ‘IFF_ALLMULTI’
#define IFF_ALLMULTI IFF_ALLMULTI
^
../include/linux/if.h:88:2: note: previous definition of ‘IFF_ALLMULTI’ was here
IFF_ALLMULTI = 1<<9, /* sysfs */
^
../include/linux/if.h:116:22: error: redeclaration of enumerator ‘IFF_MASTER’
#define IFF_MASTER IFF_MASTER
^
../include/linux/if.h:89:2: note: previous definition of ‘IFF_MASTER’ was here
IFF_MASTER = 1<<10, /* __volatile__ */
^
../include/linux/if.h:117:21: error: redeclaration of enumerator ‘IFF_SLAVE’
#define IFF_SLAVE IFF_SLAVE
^
../include/linux/if.h:90:2: note: previous definition of ‘IFF_SLAVE’ was here
IFF_SLAVE = 1<<11, /* __volatile__ */
^
../include/linux/if.h:118:25: error: redeclaration of enumerator ‘IFF_MULTICAST’
#define IFF_MULTICAST IFF_MULTICAST
^
../include/linux/if.h:91:2: note: previous definition of ‘IFF_MULTICAST’ was here
IFF_MULTICAST = 1<<12, /* sysfs */
^
../include/linux/if.h:119:23: error: redeclaration of enumerator ‘IFF_PORTSEL’
#define IFF_PORTSEL IFF_PORTSEL
^
../include/linux/if.h:92:2: note: previous definition of ‘IFF_PORTSEL’ was here
IFF_PORTSEL = 1<<13, /* sysfs */
^
../include/linux/if.h:120:25: error: redeclaration of enumerator ‘IFF_AUTOMEDIA’
#define IFF_AUTOMEDIA IFF_AUTOMEDIA
^
../include/linux/if.h:93:2: note: previous definition of ‘IFF_AUTOMEDIA’ was here
IFF_AUTOMEDIA = 1<<14, /* sysfs */
^
../include/linux/if.h:121:23: error: redeclaration of enumerator ‘IFF_DYNAMIC’
#define IFF_DYNAMIC IFF_DYNAMIC
^
../include/linux/if.h:94:2: note: previous definition of ‘IFF_DYNAMIC’ was here
IFF_DYNAMIC = 1<<15, /* sysfs */
^
In file included from ../include/xtables.h:16:0,
from ../include/iptables.h:5,
from m_ipt.c:18:
/usr/include/net/if.h:111:8: error: redefinition of ‘struct ifmap’
struct ifmap
^
In file included from m_ipt.c:17:0:
../include/linux/if.h:189:8: note: originally defined here
struct ifmap {
^
In file included from ../include/xtables.h:16:0,
from ../include/iptables.h:5,
from m_ipt.c:18:
/usr/include/net/if.h:126:8: error: redefinition of ‘struct ifreq’
struct ifreq
^
In file included from m_ipt.c:17:0:
../include/linux/if.h:226:8: note: originally defined here
struct ifreq {
^
In file included from ../include/xtables.h:16:0,
from ../include/iptables.h:5,
from m_ipt.c:18:
/usr/include/net/if.h:176:8: error: redefinition of ‘struct ifconf’
struct ifconf
^
In file included from m_ipt.c:17:0:
../include/linux/if.h:278:8: note: originally defined here
struct ifconf {
^
In file included from ../include/iptables.h:5:0,
from m_ipt.c:18:
../include/xtables.h:34:29: fatal error: xtables-version.h: No such file or directory
#include <xtables-version.h>
^
compilation terminated.
make[1]: *** [m_ipt.o] Error 1
make[1]: Leaving directory `/home/mininet/iproute2-4.6.0/tc'
make: *** [all] Error 2

请帮忙

更新

我最终更新了内核并且它工作了!

最佳答案

TC schedulers
ATM no
IPT Package xtables was not found in the pkg-config search path.

在 Ubuntu 上安装 libxtables-dev。我无法从 Fedora 中找到类似的软件包。在 Fedora 上,您可能需要从源代码构建。

Ubuntu:

$ apt-cache search xtables
libip4tc-dev - Development files for libiptc
libip4tc0 - netfilter libi4pt library
libip6tc-dev - Development files for libiptc
libip6tc0 - netfilter libipt library
libiptc-dev - Development files for libiptc
libiptc0 - netfilter libipt library
libxtables-dev - netfilter xtables library
libxtables11 - netfilter xtables library

软呢帽:

$ dnf search xtables
No matches found.
$ dnf search libxtables
No matches found.

Perhaps you should add the directory containing `xtables.pc'
to the PKG_CONFIG_PATH environment variable

如果您在 Ubuntu 上安装到 /usr/local/lib(或在 Fedora` 上安装到 /usr/local/lib64),那么您将看到如下内容:

$ ls -Al /usr/local/lib/pkgconfig/
total 88
-rw-r--r-- 1 root root 228 Oct 22 08:15 expat.pc
-rw-r--r-- 1 root root 726 Oct 19 23:56 gnutls-dane.pc
-rw-r--r-- 1 root root 911 Oct 19 23:56 gnutls.pc
-rw-r--r-- 1 root root 1199 Oct 22 08:53 guile-2.2.pc
-rw-r--r-- 1 root root 563 Oct 22 08:13 hogweed.pc
-rw-r--r-- 1 root root 315 Oct 16 06:56 libcrypto.pc
-rw-r--r-- 1 root root 1678 Oct 16 06:58 libcurl.pc
-rw-r--r-- 1 root root 860 Oct 16 06:52 libidn.pc
...

当您配置时,您可以执行以下操作:

INSTALL_PREFIX="/usr/local"
INSTALL_LIBDIR="$INSTALL_PREFIX/lib"

OPT_PKGCONFIG=("$INSTALL_LIBDIR/pkgconfig")
OPT_CPPFLAGS=("-I$INSTALL_PREFIX/include" "-DNDEBUG")
OPT_CFLAGS=("$SH_MARCH" "$SH_NATIVE")
OPT_CXXFLAGS=("$SH_MARCH" "$SH_NATIVE")
OPT_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
OPT_LIBS=("-ldl" "-lpthread")
...

PKG_CONFIG_PATH="${OPT_PKGCONFIG[*]}" \
CPPFLAGS="${OPT_CPPFLAGS[*]}" \
CFLAGS="${OPT_CFLAGS[*]}" CXXFLAGS="${OPT_CXXFLAGS[*]}" \
LDFLAGS="${OPT_LDFLAGS[*]}" LIBS="${OPT_LIBS[*]}" \
./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"
<other config options>

关于linux - 在 pkg-config 搜索路径中找不到包 xtables,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46874581/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com