include file not found
bf1783 at googlemail.com
Wed Jan 26 14:21:02 UTC 2011
Da Rock wrote:
> gcc -Wall -Wformat-security -Wno-format-zero-length -g -O3 -I.
> -I/usr/include -I/usr/local/include -DLIBDIR='"/lib/l2tpns"'
> -DETCDIR='"/etc/l2tpns"' -DSTATISTICS -DSTAT_CALLS -DRINGBUFFER
> -DHAVE_EPOLL -DBGP -c -o arp.o arp.c
> In file included from arp.c:8:
> /usr/include/net/if_arp.h:88: error: field 'arp_pa' has incomplete type
> /usr/include/net/if_arp.h:89: error: field 'arp_ha' has incomplete type
You seem to be missing definitions of struct sockaddr, so probably
sys/socket.h is needed.
> In file included from arp.c:9:
> /usr/include/netinet/if_ether.h:96: error: field 'sin_addr' has
> incomplete type
> /usr/include/netinet/if_ether.h:97: error: field 'sin_srcaddr' has
> incomplete type
Here it looks like you're missing struct in_addr, which is in
sys/netinet/in.h (and also arpa/inet.h).
> arp.c:20: error: 'ETH_ALEN' undeclared here (not in a function)
> arp.c: In function 'sendarp':
> arp.c:29: error: storage size of 'sll' isn't known
> arp.c:54: error: 'PF_PACKET' undeclared (first use in this function)
> arp.c:54: error: (Each undeclared identifier is reported only once
> arp.c:54: error: for each function it appears in.)
> arp.c:54: error: 'ETH_P_RARP' undeclared (first use in this function)
> arp.c:57: error: 'AF_PACKET' undeclared (first use in this function)
Some of these missing parameters are Linux-specific.
> arp.c:29: warning: unused variable 'sll'
> gmake: *** [arp.o] Error 1
As you can see, porting requires some care. It's not only a matter of
including different headers; there are some other differences that may
require patches, and we won't be able to go through this step-by-step
on the list. You can see what FreeBSD headers a similar FreeBSD
application needs by looking at src/usr.sbin/arp, and you can get some
help with the Linux->FreeBSD part by looking at /sys/compat/linux,
; and you might be able to cheat a bit by using a compatibility layer
like devel/gnulib, but you're going to have to go through this
carefully on your own.
More information about the freebsd-questions