返回列表 发帖

编译libdnet的问题

转载自:www.linuxsir.org 编译libdnet的问题 libdnet http://libdnet.sourceforge.net 在FC1上编译libdnet老报错,不知道怎么搞得,但是我在其他的机子上,分别是 redhat7.3和redhat7.1的OS都可以编译通过的 我make的方法及其机器的显示如下: # ./configure checking for a BSD compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking whether make sets ${MAKE}... yes checking for working aclocal-1.4... found checking for working autoconf... found checking for working automake-1.4... found checking for working autoheader... found checking for working makeinfo... missing checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for executable suffix... checking for object suffix... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for a BSD compatible install... /usr/bin/install -c checking for ranlib... ranlib checking for gethostbyname... yes checking for socket... yes checking for putmsg in -lstr... no checking for open_mib in -lnm... no checking for libcheck... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for fcntl.h... yes checking for unistd.h... yes checking for sys/bufmod.h... no checking for sys/dlpi.h... no checking for sys/dlpihdr.h... no checking for sys/dlpi_ext.h... no checking for sys/ioctl.h... yes checking for sys/mib.h... no checking for sys/ndd_var.h... no checking for sys/socket.h... yes checking for sys/sockio.h... no checking for sys/sysctl.h... yes checking for sys/time.h... yes checking for net/bpf.h... yes checking for net/if.h... yes checking for net/if_arp.h... yes checking for net/if_dl.h... no checking for net/pfvar.h... no checking for net/raw.h... no checking for net/route.h... yes checking for netinet/ip_fw.h... no checking for linux/ip_fw.h... no checking for linux/ip_fwchains.h... no checking for linux/netfilter_ipv4/ipchains_core.h... yes checking for ip_fil_compat.h... no checking for netinet/ip_fil_compat.h... no checking for ip_compat.h... no checking for netinet/ip_compat.h... no checking for ip_fil.h... no checking for netinet/ip_fil.h... no checking for hpsecurity.h... no checking for gcc option to accept ANSI C... none needed checking for an ANSI C-conforming const... yes checking for inline... inline checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... (cached) yes checking for pid_t... yes checking for size_t... yes checking for sockaddr_in6 struct in ... yes checking for sa_len in sockaddr struct... no checking for arp_dev in arpreq struct... yes checking for rt_msghdr struct in ... no checking whether gcc needs -traditional... no checking for working memcmp... yes checking for err... yes checking for strlcat... no checking for strlcpy... no checking for Berkeley Packet Filter... no checking for Linux proc filesystem... yes checking for Linux PF_PACKET sockets... yes checking for SNMP MIB2 STREAMS... no checking for route(7) STREAMS... no checking for arp(7) ioctls... yes checking for raw IP sockets ip_{len,off} host byte ordering... no checking for cooked raw IP sockets... no configure: creating ./config.status config.status: creating Makefile config.status: creating dnet-config config.status: creating include/Makefile config.status: creating include/dnet/Makefile config.status: creating man/Makefile config.status: creating src/Makefile config.status: creating test/Makefile config.status: creating test/check/Makefile config.status: creating test/dnet/Makefile config.status: creating include/config.h # make Making all in include make[1]: Entering directory `/root/libdnet-1.7/include'; make all-recursive make[2]: Entering directory `/root/libdnet-1.7/include'; Making all in dnet make[3]: Entering directory `/root/libdnet-1.7/include/dnet'; make[3]: Nothing to be done for `all';. make[3]: Leaving directory `/root/libdnet-1.7/include/dnet'; make[3]: Entering directory `/root/libdnet-1.7/include'; make[3]: Leaving directory `/root/libdnet-1.7/include'; make[2]: Leaving directory `/root/libdnet-1.7/include'; make[1]: Leaving directory `/root/libdnet-1.7/include'; Making all in man make[1]: Entering directory `/root/libdnet-1.7/man'; make[1]: Nothing to be done for `all';. make[1]: Leaving directory `/root/libdnet-1.7/man'; Making all in src make[1]: Entering directory `/root/libdnet-1.7/src'; gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c addr-util.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c addr.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c blob.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c ip-util.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c ip6.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c rand.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c strlcat.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c strlcpy.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c arp-ioctl.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c eth-linux.c gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -g -O2 -Wall -c fw-ipchains.c In file included from fw-ipchains.c:15: /usr/include/linux/ip.h:95: error: syntax error before "__u8" /usr/include/linux/ip.h:102: error: syntax error before "tot_len" /usr/include/linux/ip.h:103: error: syntax error before "id" /usr/include/linux/ip.h:104: error: syntax error before "frag_off" /usr/include/linux/ip.h:105: error: syntax error before "ttl" /usr/include/linux/ip.h:106: error: syntax error before "protocol" /usr/include/linux/ip.h:107: error: syntax error before "check" /usr/include/linux/ip.h:108: error: syntax error before "saddr" /usr/include/linux/ip.h:109: error: syntax error before "daddr" In file included from /usr/include/linux/tcp.h:21, from fw-ipchains.c:16: /usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include instead! In file included from fw-ipchains.c:16: /usr/include/linux/tcp.h:105: error: braced-group within expression allowed only inside a function /usr/include/linux/tcp.h:105: error: enumerator value for `TCP_FLAG_CWR'; not integer constant /usr/include/linux/tcp.h:106: error: syntax error before "__u32" /usr/include/linux/tcp.h:107: error: syntax error before "__u32" /usr/include/linux/tcp.h:108: error: syntax error before "__u32" /usr/include/linux/tcp.h:109: error: syntax error before "__u32" /usr/include/linux/tcp.h:110: error: syntax error before "__u32" /usr/include/linux/tcp.h:111: error: syntax error before "__u32" /usr/include/linux/tcp.h:112: error: syntax error before "__u32" /usr/include/linux/tcp.h:113: error: syntax error before "__u32" /usr/include/linux/tcp.h:114: error: syntax error before "__u32" In file included from fw-ipchains.c:25: /usr/include/linux/netfilter_ipv4/ipchains_core.h:114: error: field `fwp_iph'; has incomplete type make[1]: *** [fw-ipchains.o] Error 1 make[1]: Leaving directory `/root/libdnet-1.7/src'; make: *** [all-recursive] Error 1 有知道怎么回事的xdjm支会我一下,非常感谢! __________________ 如果有钱也是一种错,我宁愿一错再错。 PIII 733+128M SDRAM+GeForce2 MX200+Fedora Core 1 -------------------------------------------------------------------------------- 由 ppgo 在 04-18-2004 13:39 发表: 终于找到了解决方案,FC1的ip.h和tcp.h确实有问题。 (1) The first set of errors, /usr/include/linux/ip.h:95: syntax error before "__u8" /usr/include/linux/ip.h:102: syntax error before "tot_len" /usr/include/linux/ip.h:103: syntax error before "id" /usr/include/linux/ip.h:104: syntax error before "frag_off" /usr/include/linux/ip.h:105: syntax error before "ttl" /usr/include/linux/ip.h:106: syntax error before "protocol" /usr/include/linux/ip.h:107: syntax error before "check" /usr/include/linux/ip.h:108: syntax error before "saddr" /usr/include/linux/ip.h:109: syntax error before "daddr" can be eliminated by adding to fw-ipchains. This adds the definition for __u8 and __u32. (2) The second set of errors, /usr/include/linux/tcp.h:105: braced-group within expression allowed only inside a function /usr/include/linux/tcp.h:105: enumerator value for `TCP_FLAG_CWR'; not integer co nstant /usr/include/linux/tcp.h:106: syntax error before "__u32" /usr/include/linux/tcp.h:107: syntax erro

返回列表 回复 发帖