title: XCode 4.5, Static Libraries, and Categories
body: <p>I'm trying to use a static library, and the categories that are in it aren't being used at run-time.  There are no compile-time errors, but when I go to run, I get the standard 'unrecognized selector sent to instance' message and my app crashes.</p>
  
  <p>Many solutions say to add <code>-ObjC -all_load</code> to the "Other Linker Flags" property in your application's target (many others say that as of XCode 4, that is no longer needed, this is the only reason I have bothered to include the XCode version).  I've tried it and I get 115 errors during build:</p>
  
  <p><code>Undefined symbols for architecture i386:
    "_CLLocationCoordinate2DMake", referenced from:
        -[QMapElement init] in libQuickDialog.a(QMapElement.o)
    "_OBJC_CLASS_$_MKMapView", referenced from:
        objc-class-ref in libQuickDialog.a(QMapViewController.o)
    "_OBJC_CLASS_$_MKPinAnnotationView", referenced from:
        objc-class-ref in libQuickDialog.a(QMapViewController.o)
    "std::istream::gcount() const", referenced from:
        GT::AES::decode(std::istream&amp;, std::ostream&amp;, unsigned int&amp;, bool) in GD(gtaes.o)
        GT::AES::encode(std::istream&amp;, std::ostream&amp;, unsigned int&amp;, bool) in GD(gtaes.o)
    "std::string::find_first_of(char const*, unsigned long, unsigned long) const", referenced from:
        -[GDSetPasswordViewController checkPasswordStrength:] in GD(GDSetPasswordViewController.o)
        GD::EacpCReq::EacpCReq(std::string, std::string, GT::Dbb&amp;) in GD(GDEacpCommands.o)
        GD::RawSocket::connect() in GD(GDRawSocket.o)
    "std::string::copy(char*, unsigned long, unsigned long) const", referenced from:
        GD::Socket::toString() const in GD(GDSocket.o)</code></p>
  
  <p>(and so on, that's about 5 or 6 of the 115).</p>
  
  <p>Whether I have either of those linker flags, or both, I get the exact same set of errors.  </p>
  
  <p>Not sure if this is the culprit, or just coincidental, but after looking at the errors a little more closely, it seems like they are all from one of two 3rd-party libraries I am using.  One as an installed .framework, the other as a regular static library. Maybe I need to do something to their builds (if possible), as well?
  Thanks!</p>