I have a program (main.c) that includes the header rpc/rpc.h which includes the header netinet/in.h which contains the header cygwin/in.h which contains the struct "sockaddr_in":
1 2 3 4 5 6 7 8 9 10
|
struct sockaddr_in
{
sa_family_t sin_family; /* Address family */
in_port_t sin_port; /* Port number */
struct in_addr sin_addr; /* Internet address */
/* Pad to size of `struct sockaddr'. */
unsigned char __pad[__SOCK_SIZE__ - sizeof(short int)
- sizeof(unsigned short int) - sizeof(struct in_addr)];
};
|
For some reason when I try to compile it this happens:
$ gcc-3.exe -Wall -O2 -IC:/cygwin/usr/include/tirpc -IC:/cygwin/usr/include -c C:/cygwin/home/eb/rap00/main.c -o obj/Release/main.o
C:/cygwin/home/eb/rap00/main.c: In function `main':
C:/cygwin/home/eb/rap00/main.c:50: error: `sockaddr_in' undeclared (first use in this function)
C:/cygwin/home/eb/rap00/main.c:50: error: (Each undeclared identifier is reporte d only once
C:/cygwin/home/eb/rap00/main.c:50: error: for each function it appears in.)
C:/cygwin/home/eb/rap00/main.c:50: error: `addr' undeclared (first use in this f unction)
C:/cygwin/home/eb/rap00/main.c:53: warning: implicit declaration of function `in et_pton'
The offending line is this:
sockaddr_in *addr;
Why is GCC choking?