I have these three structures:
Code:
typedef uint32_t LINX_SPID;
struct sockaddr_linx
{
sa_family_t family;
LINX_SPID spid;
};
typedef struct protocolstruct ProtocolStruct;
struct protocolstruct
{
struct sockaddr_linx sin1,
sin2;
int nodelay;
struct hostent *addr;
int sndbufsz,
rcvbufsz;
#if defined(INFINIBAND)
IB_mtu_t ib_mtu;
int commtype;
int comptype;
#endif
};
typedef struct argstruct ArgStruct;
struct argstruct
{
...
<lots of other irrelevant declarations>
struct protocolstruct prot;
};
But, when I run the program, I get the error
Code:
error: field 'prot' has incomplete type
and it is pointing to the line in blue.
The only thing that can cause problems in "prot" is
struct sockaddr_linx sin1, sin2;
But, the struct sockaddr_linx has been declared in the same file. Why am I getting this error?