Undefined symbols for architecture armv7? What does this error mean?
Asked Answered
S

3

5

I just marked all of my CocoaAsyncSocket code as non-ARC code, and it's given me these 3 errors:

Undefined symbols for architecture armv7:
  "_kCFStreamNetworkServiceTypeVoIP", referenced from:
      -[GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GCDAsyncSocket.o
  "_kCFStreamNetworkServiceType", referenced from:
      -[GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GCDAsyncSocket.o
  "_kCFStreamPropertySSLSettings", referenced from:
      -[GCDAsyncSocket maybeStartTLS] in GCDAsyncSocket.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anybody know what this means and how to fix it?

Specter answered 27/12, 2011 at 21:16 Comment(1)
Are you linking against CFNetwork?Maidenly
C
4

It means that some code you are compiling is referencing the constants "kCFStreamNetworkServiceTypeVoIP", "kCFStreamNetworkServiceType", and "kCFStreamPropertySSLSettings", but that those constants weren't found when it tried to link your code with the libraries it uses.

Unfortunately there's a bunch of reasons this could be:

  • You could have misspelled them
  • They could be #ifdef'd out for that architecture
  • You might not be linking the correct librar(y, ies)
  • They could be marked as having 'hidden' visibility so that they can only be used in the declaring library
  • Probably other reasons

You can use 'nm' to poke at the exported symbols from the binary of a library, and 'otool -L' to check which libraries your binary is linking.

Chevalier answered 27/12, 2011 at 21:32 Comment(0)
E
16

I think I found the solution to this, by looking in the code comments, but I now see that it's also what Mark Adams suggested above. I had the errors until I added the CFNetwork.framework under Targets->Build Phases->Link Binary With Libraries->Select CFNetwork.framework

Escapade answered 24/1, 2012 at 13:38 Comment(2)
@Escapade This helps. I didn't know, being ios noob, that you need to add frameworks manually. I somehow guessed that everything is included already. Linked Frameworks and library -> click plus sign -> add framework works for me. I had this same type of mistake in C#, but there Visual Studio notifies you. I think... Anyway thanks.Priebe
I got the error in OS X 10.9, and was resolved by including the CFNetwork.Framework.Katlynkatmai
C
4

It means that some code you are compiling is referencing the constants "kCFStreamNetworkServiceTypeVoIP", "kCFStreamNetworkServiceType", and "kCFStreamPropertySSLSettings", but that those constants weren't found when it tried to link your code with the libraries it uses.

Unfortunately there's a bunch of reasons this could be:

  • You could have misspelled them
  • They could be #ifdef'd out for that architecture
  • You might not be linking the correct librar(y, ies)
  • They could be marked as having 'hidden' visibility so that they can only be used in the declaring library
  • Probably other reasons

You can use 'nm' to poke at the exported symbols from the binary of a library, and 'otool -L' to check which libraries your binary is linking.

Chevalier answered 27/12, 2011 at 21:32 Comment(0)
C
0

I had this same error when integrating LineaPro API into an app.

The fix i implemented was adding ExternalAccessory.framework to General -> Linked Framework and Libraries.

I already had CFNetwork.framework included.

Clerihew answered 7/9, 2014 at 4:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.