25

I received these errors after I added " -all_load " in the "Other Linker Flags" build setting once I added "libPusher-combined.a" and its header files. I followed the instructions exactly up to the part of typing in "-all_load" (under "Using a pre-compiled static library" in the "Adding to your iOS Project", but I ended up getting 20 Mach-O Linker errors. :/ Could anyone please help me with this?

Here are the errors:

Undefined symbols for architecture armv7:
 "_utf8_nextCharSafeBody", referenced from:
  -[SRWebSocket _pumpScanner] in libPusher-combined.a(SRWebSocket.o)
 "_SCError", referenced from:
  -[Reachability startNotifier] in libPusher-combined.a(Reachability.o)
 "_utf8_countTrailBytes", referenced from:
  -[SRWebSocket _pumpScanner] in libPusher-combined.a(SRWebSocket.o)
 "_SCNetworkReachabilitySetDispatchQueue", referenced from:
  -[Reachability startNotifier] in libPusher-combined.a(Reachability.o)
  -[Reachability stopNotifier] in libPusher-combined.a(Reachability.o)
 "_kCFHTTPVersion1_1", referenced from:
  -[SRWebSocket didConnect] in libPusher-combined.a(SRWebSocket.o)
"_CFHTTPMessageIsHeaderComplete", referenced from:
  ___30-[SRWebSocket _readHTTPHeader]_block_invoke_0 in libPusher-combined.a(SRWebSocket.o)
 "_CFHTTPMessageCreateRequest", referenced from:
  -[SRWebSocket didConnect] in libPusher-combined.a(SRWebSocket.o)
 "_SCNetworkReachabilityCreateWithAddress", referenced from:
  +[Reachability reachabilityWithAddress:] in libPusher-combined.a(Reachability.o)
 "_SCErrorString", referenced from:
  -[Reachability startNotifier] in libPusher-combined.a(Reachability.o)
 "_SCNetworkReachabilityCreateWithName", referenced from:
  +[Reachability reachabilityWithHostname:] in libPusher-combined.a(Reachability.o)
 "_CFHTTPMessageCopyAllHeaderFields", referenced from:
  ___30-[SRWebSocket _readHTTPHeader]_block_invoke_0 in libPusher-combined.a(SRWebSocket.o)
 "_CFHTTPMessageGetResponseStatusCode", referenced from:
  -[SRWebSocket _HTTPHeadersDidFinish] in libPusher-combined.a(SRWebSocket.o)
 "_CFHTTPMessageSetHeaderFieldValue", referenced from:
  -[SRWebSocket didConnect] in libPusher-combined.a(SRWebSocket.o)
  ___25-[SRWebSocket didConnect]_block_invoke_0 in libPusher-combined.a(SRWebSocket.o)
 "_CFHTTPMessageCreateEmpty", referenced from:
  -[SRWebSocket _readHTTPHeader] in libPusher-combined.a(SRWebSocket.o)
 "_CFHTTPMessageCopySerializedMessage", referenced from:
  -[SRWebSocket didConnect] in libPusher-combined.a(SRWebSocket.o)
 "_SCNetworkReachabilitySetCallback", referenced from:
  -[Reachability startNotifier] in libPusher-combined.a(Reachability.o)
  -[Reachability stopNotifier] in libPusher-combined.a(Reachability.o)
 "_SCNetworkReachabilityGetFlags", referenced from:
  -[Reachability isReachable] in libPusher-combined.a(Reachability.o)
  -[Reachability isReachableViaWWAN] in libPusher-combined.a(Reachability.o)
  -[Reachability isReachableViaWiFi] in libPusher-combined.a(Reachability.o)
  -[Reachability connectionRequired] in libPusher-combined.a(Reachability.o)
  -[Reachability isConnectionOnDemand] in libPusher-combined.a(Reachability.o)
  -[Reachability isInterventionRequired] in libPusher-combined.a(Reachability.o)
  -[Reachability reachabilityFlags] in libPusher-combined.a(Reachability.o)
  ...
 "_CFHTTPMessageCopyHeaderFieldValue", referenced from:
  -[SRWebSocket _checkHandshake:] in libPusher-combined.a(SRWebSocket.o)
 "_CFHTTPMessageAppendBytes", referenced from:
  ___30-[SRWebSocket _readHTTPHeader]_block_invoke_0 in libPusher-combined.a(SRWebSocket.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If you need more information, just ask. I hope that I'm not giving too much trouble. Thanks in advance.

chrisjr
  • 760
  • 3
  • 11
  • 18

6 Answers6

74

Check to make sure you included the following frameworks (via https://github.com/square/SocketRocket) :

Framework Dependencies

Your .app must be linked against the following frameworks/dylibs

libicucore.dylib CFNetwork.framework Security.framework Foundation.framework

Todd Hopkinson
  • 6,803
  • 5
  • 32
  • 34
27

Make sure that you also have -licucore in "Other Linker Flags", in the build settings tab, as in the attached screenshot:

Other Linker Flags

Marius
  • 3,589
  • 3
  • 27
  • 30
5

I copied the complete SocketRocket folder into my application for using web sockets in my application and linked libicucore.dylib, CFNetwork.framework, Security.framework, Foundation.framework binaries with my project. This removed all my errors and warnings.

sarabdeep singh
  • 878
  • 1
  • 11
  • 16
5

For the latest sdk, you should add:

libicucore.tbd 

since libicucore.dylib is not present anymore.

hope .tbd extension is not for "to be delete"?

movaction.com
  • 537
  • 6
  • 6
4

Can you check out in your target->Build Phase. whether these files exist there or not ? and if you are running for simulator then first you need to make a build for simulator of that library whatever i guess you are using SRWebSocket library. Just open that project and just make a build for simulator and copy the files from build folder and then add to your project and do the same for the device if you are running your app on device.

Praveen-K
  • 3,401
  • 1
  • 23
  • 31
  • Let me know, if you are still facing any problem. :) – Praveen-K Mar 29 '12 at 18:56
  • Well, it worked, and the errors are gone, but they are replaced by 13 warnings. – chrisjr Mar 29 '12 at 19:02
  • Hmmm, well those warning i guess you can solve. or just tell us those warnings, lets see if i can help you. – Praveen-K Mar 29 '12 at 19:05
  • Whoops. False alarm; the 20 errors are still there in addition to the 13 warnings. – chrisjr Mar 29 '12 at 19:05
  • The same errors that I was trying to get rid of in the first place are still there. But now, I also have 14 new warnings. – chrisjr Mar 29 '12 at 19:08
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/9477/discussion-between-praveen-k-and-junior117) – Praveen-K Mar 29 '12 at 19:09
  • warning: no rule to process file '$(PROJECT_DIR)/headers/../PTEventListener.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusher.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherAPI.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherChannel.h' of type sourcecode.c.h for architecture armv7 – chrisjr Mar 29 '12 at 19:09
  • warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherConnection.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherDelegate.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherErrors.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherEvent.h' of type sourcecode.c.h for architecture armv7 – chrisjr Mar 29 '12 at 19:11
  • warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherEventDispatcher.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherEventPublisher.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherMacros.h' of type sourcecode.c.h for architecture armv7 – chrisjr Mar 29 '12 at 19:11
  • warning: no rule to process file '$(PROJECT_DIR)/headers/../PTPusherPresenceChannelDelegate.h' of type sourcecode.c.h for architecture armv7 warning: no rule to process file '$(PROJECT_DIR)/headers/../SRWebSocket.h' of type sourcecode.c.h for architecture armv7 – chrisjr Mar 29 '12 at 19:12
  • @Praveen-K hey i just went through all these comments of yours as you helped chrisjr, i'm facing the similar problem and i have tried every solution and the errors stay. can you help me? – shahtaj khalid Aug 02 '18 at 17:03
2

In my case when I added SystemConfiguration.framework to the project and problem went... :-)

Javier
  • 91
  • 1