APPLE MACH-O LINKED ERROR After adding AFNetworking
Asked Answered
D

4

24

Just adding AFNetworking into my project, and after B&R here i got this error like:

Undefined symbols for architecture i386:
"_SecCertificateCopyData", referenced from:
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in       AFURLConnectionOperation.o
"_SecCertificateCreateWithData", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in  AFURLConnectionOperation.o
"_SecPolicyCreateBasicX509", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustCopyPublicKey", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustCreateWithCertificates", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustEvaluate", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustGetCertificateAtIndex", referenced from:
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustGetCertificateCount", referenced from:
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Have already checked framework,libs and compile source, or re-add AFURLConnection.m, it won't work either.

Can anyone please help me out? thanks a lot...

Denominate answered 2/8, 2013 at 16:0 Comment(2)
Are you sure that you added the Security.framework?Gymnasiast
Succeed,Thank you so..o much.@MartinR Yet oddly enough, in the sample demo without Security.framework it can run as normal.Just in my own project got this err.Denominate
A
77

You need to add the Security.framework in order for it to build.

Amass answered 2/8, 2013 at 16:0 Comment(1)
Thanks. I also needed to add all the frameworks that were in the example project.Cookshop
C
16

For mine, I have to add

  • Security.framework
  • SystemConfiguration.framework
  • MobileCoreServices.framework
Cushman answered 23/11, 2013 at 10:21 Comment(1)
This combination worked for me, whereas solely adding "Security.framework" didn't work. AFNetworking needs to specify this out, it's so lack of good documentations.Schistosomiasis
L
0

I had a very similar issue and was seeing about 15 mach -0 linker compiler error messages. Adding the security framework reduced that # to 7 errors.

Did some more research and found that you might also need to add the SystemConfiguration.framework via xCode.

This completely resolved the issue for me.

As an FYI - I was using xCode 5, targeting iOS 7 and using AFNetworking version 2.0.

Adding as an answer, in case other people find that simply adding security.framework doesnt resolve things for them.

Thanks to Cody above for the accepted answer.

Lingerie answered 20/11, 2013 at 12:48 Comment(0)
B
0

OS X, I had to add:

  • Security.framework
  • SystemConfiguration.framework
Busyness answered 19/12, 2013 at 17:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.