【发布时间】:2012-02-16 15:48:17
【问题描述】:
我尝试使用
struct sockaddr_in sin;
但如果我使用它,我会得到
Variable has incomplete type 'struct sockaddr_in'
和
Forward declaration of 'struct sockaddr_in'
作为错误。 使用 Xcode4 时出现错误。在 Xcode3.2 中它可以工作。 有人知道如何解决这个错误吗? 我的进口是
#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>
【问题讨论】:
-
你的代码中真的拼写为
struck吗? -
没关系,你说它适用于 Xcode 3。
-
我编辑了我的错误,得到了第二个
标签: iphone objective-c ios ios5 compiler-errors