title: Objective-C: Why am I getting a compile error when importing a header file?
body: <p>I'm curious what some reasons might be as to getting a compiler error for simply importing a header file. If I comment it out, everything compiles just fine -- the header/implementation for the class I'm trying to import into one of my UIViewController's get passed the compiler without any warnings. However, as soon as I include it, I get a multitude of errors.</p>
  
  <p>I'm trying to use Apple's Reachability app in my own code, and by doing something like:</p>
  
  <pre><code>#import "Reachability.h"
  </code></pre>
  
  <p>I get a ton of:</p>
  
  <pre><code>error: syntax error before 'target'
  error: syntax error before 'SCNetworkReachabilityFlags'
  error: syntax error before 'SCNetworkReachabilityRef'
  error: syntax error before 'SCNetworkReachabilityRef'
  fatal error: method definition not in @implementation context
  </code></pre>
  
  <p>It's mostly complaining regarding:</p>
  
  <pre><code>static void ReachabilityCallback(SCNetworkReachabilityRef target,       SCNetworkReachabilityFlags flags, void *info);
  - (BOOL)isNetworkAvailableFlags:(SCNetworkReachabilityFlags *)outFlags;
  - (SCNetworkReachabilityRef)reachabilityRefForHostName:(NSString *)hostName;
  - (CFRunLoopRef)startListeningForReachabilityChanges:(SCNetworkReachabilityRef)reachability onRunLoop:(CFRunLoopRef)runLoop;
  </code></pre>
  
  <p>Any idea why this is only happening when I try to import the header file?</p>