Can someone please explain what is happening here. If I select Link all assemblies or Link SDK assemblies only for the linker behavior in the project build options, then I get the following linking errors occurring in my static library, libUltralite.a.
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)
If I instead chose Don't link for the Linker behavior, 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).
My additional mtouch arguments under the project build options are as follows:
-v -v -v -gcc_flags "-lstdc++ -I${ProjectDir}/Ultralite/Include -L${ProjectDir}/Ultralite -lUltralite -force_load ${ProjectDir}/Ultralite/libUltralite.a"
I have concluded from a simple example that MonoTouch works correctly on the simulator and on the actual device with Linker behavior set at Link SDK assemblies only, 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 Linker behavior option set, I would be very grateful.