Netinet compile probs

Netinet compile probs

Post by Matthew L. Creec » Sun, 14 Jan 2001 09:58:37



When I try to compile programs that include netinet/ip.h or other header
files in netinet, I'm getting errors.  Anybody know what's causing
this?  Here's an example:

gt$ cc -o poot poot.c
In file included from poot.c:3:
/usr/include/netinet/ip.h:54: syntax error before `u_int'
/usr/include/netinet/ip.h:73: field `ip_src' has incomplete type
/usr/include/netinet/ip.h:73: field `ip_dst' has incomplete type
/usr/include/netinet/ip.h:144: syntax error before `u_char'
/usr/include/netinet/ip.h:156: syntax error before `n_long'
/usr/include/netinet/ip.h:158: field `ipt_addr' has incomplete type
/usr/include/netinet/ip.h:159: syntax error before `n_long'
gt$

The files seem to be fine so I assume I'm probably missing something
retardedly obvious - any suggestions?  thx

--
Matthew L. Creech

 
 
 

1. Compile problems with netinet/in.h

Ain't porting fun?

Every Unix vendor has their include files set up in different,
intricate, typically incompatible, ways. On Solaris 2.6, trying to
compile (with CC) a file which includes <netinet/in.h> gives the
following errors (this is just the first few lines):

"/usr/include/sys/resource.h", line 115: Error: The type "timeval" is
incomplete.
"/usr/include/sys/resource.h", line 116: Error: The type "timeval" is
incomplete.
"/usr/include/sys/vnode.h", line 87: Error: Type name expected instead
of "u_short".
"/usr/include/sys/vnode.h", line 87: Error: No storage class or type for
this declaration.
"/usr/include/sys/vnode.h", line 87: Error: "," expected instead of
"v_flag".
[and so on]

Ok, so I found that to get struct timeval defined I evidently need to
define _XPG4_2. Dandy. Having done that I now see that the BSD socket
funcs get renamed to xnet_something an I'll need to link with -lxnet.
Fine with me. Compiling with _XPG4_2, though, gives this:

Error: The function __xnet_socket must have a prototype.

This thing ain't playing fair. I'd appreciate any advice and/or pointers
to docs or web resources that would help me clarify just which elephants
I need to balance on which bowling balls to get a clean compile. That
is, I'm trying to find the magic combination of things to define, files
to include (in what order), etc to get past this roadblock. Many thanks.

--
Guy Finney

2. pl. help: K7V audio problem

3. Compiling dosemu: "...not file netinet/if.h"

4. battery power supply for linuxppc

5. Q: problems compiling when including netinet/ip.h

6. Way Cool.

7. Satan compile bugs, netinet/*.h incompatible?

8. Mac server security

9. Can't compile with netinet/in.h on Solaris 2.6

10. where to find /usr/include/bsd/netinet/ip_var.h & ip.h

11. netinet include files

12. need netinet/*.h header files.

13. netinet/ip_tcp.h getting clobbered