include file not found
freebsd-questions at herveybayaustralia.com.au
Wed Jan 26 17:52:20 UTC 2011
On 01/27/11 00:21, b. f. wrote:
> 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.
Got that one.
>> 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).
And that one- missed arpa/inet.h though :)
>> 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,
Yes, I was thinking of asking that question. linux/packet.h system, is
there a compatible bsd version to this (even deprecated?)? Mind you,
from what I've read it could even be deprecated itself :) It was
released in 2002 after all. According to some references, you're
supposed to be using kernel/if_ether.h. The code I'm building doesn't
appear to have changed much in nearly a year, so I don't know.
> ; 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.
I'm hoping to win this one myself; I've been trying to get a better
handle on the internals of FreeBSD so I can do more patching when things
go wrong and be able to submit those instead of complaining its just
'broke'. This just might help me 'cut my teeth'. I might ask just a few
dumb questions along the way though :)
One thing I don't understand, though, apparently this code just builds
on FreeBSD according to the site I'm following (7.2). I'm going to have
a closer look at that and see whats up...
More information about the freebsd-questions