Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
399 views
in Technique[技术] by (71.8m points)

iphone - Xcode 4.2 - declaration of '...' will not be visible outside of this function warning

I use Apple Reachability class from Apple Sample code Reachability

in Xcode 4.2 and new Apple 3.0 compiler I get warning in this class that

+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;

declaration of 'struct sockaddr_in' will not be visible outside of this function*

I am not good at classic C %) so I dont understand how I can fix this warning or may be I can ignore it at all.

Thx

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Add #import <netinet/in.h> in Reachability.h to get away with this


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...