title: Linker options 'Link all assemblies" and "Link SDK assemblies only" causes undefined symbols in 3rd party static library
body: <p>Can someone please explain what is happening here. If I select <em>Link all assemblies</em> or <em>Link SDK assemblies only</em> for the <em>linker behavior</em> in the project build options, then I get the following linking errors occurring in my static library, libUltralite.a.</p>
  
  <pre><code>Undefined symbols:
  "_SecRandomCopyBytes", referenced from:
    _zcbdb539311e3 in libUltralite.a(03b1278799.o)  
  "_SecTrustSetAnchorCertificates", referenced from:
    zda160c9852f6::z41eb5883fa2f(__CFArray const*)  in libUltralite.a(fb6da25cb9.o)
  "_SecKeyGetBlockSize", referenced from:
    _zd0743c47573a in libUltralite.a(f43c4e48ce.o)
  "_SecCertificateCopySubjectSummary", referenced from:
    zda160c9852f6::z41eb5883fa2f(__CFArray const*)  in libUltralite.a(fb6da25cb9.o)
  "_SecPolicyCreateSSL", referenced from:
    zda160c9852f6::z41eb5883fa2f(__CFArray const*)  in libUltralite.a(fb6da25cb9.o)
  "_SecTrustCopyPublicKey", referenced from:
    _z2cfcc7397b7e in libUltralite.a(f43c4e48ce.o)
  "_SecTrustCreateWithCertificates", referenced from:
    zda160c9852f6::z41eb5883fa2f(__CFArray const*)  in libUltralite.a(fb6da25cb9.o)
    _z2cfcc7397b7e in libUltralite.a(f43c4e48ce.o)
  "_SecCertificateCreateWithData", referenced from:
    zda160c9852f6::z635831b310af(unsigned char*, unsigned long)in libUltralite.a(fb6da25cb9.o)
    _z2cfcc7397b7e in libUltralite.a(f43c4e48ce.o)
  "_kSecRandomDefault", referenced from:
    _kSecRandomDefault$non_lazy_ptr in libUltralite.a(03b1278799.o)
   (maybe you meant: _kSecRandomDefault$non_lazy_ptr)
  "_SecKeyEncrypt", referenced from:
    _zb27eee72717c in libUltralite.a(f43c4e48ce.o)
  "_SecPolicyCreateBasicX509", referenced from:
    _z2cfcc7397b7e in libUltralite.a(f43c4e48ce.o)
  "_SecTrustEvaluate", referenced from:
    zda160c9852f6::z41eb5883fa2f(__CFArray const*)  in libUltralite.a(fb6da25cb9.o)
    _z2cfcc7397b7e in libUltralite.a(f43c4e48ce.o)
  </code></pre>
  
  <p>If I instead chose <em>Don't link</em> for the <em>Linker behavior</em>, then the linking works and does not throw any errors, but the application crashes at startup on an actual iphone. The application does not crash on the simulator, it only crashes on an actual iphone. (Yes, I did recompile my static library for the actual device... so the library being included is for the correct platform).</p>
  
  <p>My <em>additional mtouch arguments</em> under the project <em>build</em> options are as follows:</p>
  
  <pre><code>-v -v -v -gcc_flags "-lstdc++ -I${ProjectDir}/Ultralite/Include -L${ProjectDir}/Ultralite -lUltralite -force_load ${ProjectDir}/Ultralite/libUltralite.a"
  </code></pre>
  
  <p>I have concluded from a simple example that MonoTouch works correctly on the simulator and on the actual device with <em>Linker behavior</em> set at <em>Link SDK assemblies only</em>, but I am needing to find out why linking to my static library is not working correctly with this option set. If someone could shed some light on the linking errors that I am getting or propose a workaround to get my application linking correctly with this <em>Linker behavior</em> option set, I would be very grateful.</p>