Tuesday, September 27, 2011

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

Everybody and their mom has own modified Reachability code and none are compatible. Yet another fix to the "default" code, in case you see this kind of warning or error (no-warnings policy):
Reachability.h: error: declaration of 'struct sockaddr_in' will not be visible outside of this function [-Werror,3]
Fix is easy, just add this:
#import <netinet/in.h>
Hope Apple would pull together all "fixes" and update the Reachability master version for all of us.

4 comments:

  1. Great thanks. That had me puzzled for a while

    ReplyDelete
  2. Thanks! That warning was bugging me as well.

    ReplyDelete
  3. Thanks, you helped yet another person!

    ReplyDelete