Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Variable has incomplete type 'struct sockaddr_in'

I try to use the

 struct sockaddr_in sin;

but if I use this I get

Variable has incomplete type 'struct sockaddr_in' 

and

Forward declaration of 'struct sockaddr_in'

as Error. I get error when I use Xcode4. In Xcode3.2 it works. Does someone know how to solve this error?? My imports are

#import <sys/socket.h>
#import <netinet/in.h>
#import <netinet6/in6.h>
#import <arpa/inet.h>
#import <ifaddrs.h>
#include <netdb.h>
#import <SystemConfiguration/SCNetworkReachability.h>
like image 255
Starbax Avatar asked Jan 23 '12 09:01

Starbax


1 Answers

did you link your target with these two libraries?

  • CFNetwork
  • SystemConfiguration

enter image description here

like image 57
Flori Avatar answered Oct 12 '22 10:10

Flori