cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
11,040 Views
Registered: ‎05-21-2008

invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'

Jump to solution

 

  We've upgraded from 8.2 to 10.1 to get the lwip 1.3 which is supposed to fix some etherenet lockups.

 

   We're using xps_ethernetlite

 

   When we compile, we are getting an interesting error in the following function:

 

 error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in' 

 

 

static struct sockaddr_in remote_host_addr;


int send_udp_pkt( char *buf, int len )
{
    return lwip_sendto( udp_out_sock, buf, len, 0,
        (struct sockaddr*)&remote_host_addr, sizeof(remote_host_addr) );
}


Our "includes" are at the end of this message.

 

  I have tracked the  definition of sockaddr_in all the way through the header chain, and it _is_ complete.  I'm also not getting any errors for undefined header files.  _All_ header files are being found.

 

  Any clues?

 

thanks,

wade

 

 

 

#include "xparameters.h"
#include "xbasic_types.h"
#include "xstatus.h"


/* lwIP Includes */
#include "lwip/sys.h"
#include "lwip/ip_addr.h"
#include "lwip/sockets.h"
#include "lwip/memp.h"

#include "lwip/netif.h"
#include "lwip/tcpip.h"

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
12,833 Views
Registered: ‎05-21-2008

  Doh!   I found it after 2 days of looking!

 

  The lwip 1.30 configuration screen had "RAW_API" chosen!  It needed to be SOCKET_API.

 

   The interesting thing is that the error message was so far out in left field, it didn't register.

 

   ALSO, the default BSB for a PPC xps_etherenetlite does not wire in the xps_intc controller!

View solution in original post

0 Kudos
2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
11,019 Views
Registered: ‎01-18-2008
Sounds odd. Could you add -save-temps to your compile flags for the application, and post the resulting .i file?
0 Kudos
Highlighted
Observer
Observer
12,834 Views
Registered: ‎05-21-2008

  Doh!   I found it after 2 days of looking!

 

  The lwip 1.30 configuration screen had "RAW_API" chosen!  It needed to be SOCKET_API.

 

   The interesting thing is that the error message was so far out in left field, it didn't register.

 

   ALSO, the default BSB for a PPC xps_etherenetlite does not wire in the xps_intc controller!

View solution in original post

0 Kudos