5

In My Xcode project I had integrated XMPP framework. It works fine on the iOS 5.1 simulator. When I tried to run the project on the iOS 4.3 simulator I am getting the following error:

dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong
  Referenced from: /Users/admin/Library/Application Support/iPhone Simulator/4.3.2/Applications/67451DE6-EFC1-4313-9A29-C2C641F727C6/AppName.app/AppName
  Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

dyld: Symbol not found: _objc_storeStrong
  Referenced from: /Users/admin/Library/Application Support/iPhone Simulator/4.3.2/Applications/67451DE6-EFC1-4313-9A29-C2C641F727C6/AppName.app/AppName
  Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

The error occurred on the following line of code : xmppStream = [[XMPPStream alloc] init];

After Further debugging I found that the error occurs here :

- (id)init
{
    if ((self = [super init])) //**CRASH WHEN EXECUTING THIS STATEMENT
    {
        // Common initialization
        [self commonInit];

        // Initialize socket
        asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:xmppQueue];
    }
    return self;
}


The project I integrated XMPP is not an ARC. So I added -fobjc-arc against all XMPP files. The sample project given by XMPP library is working fine on the iOS 4.3 simulator. Can anyone help me in resolving this error?
Xcode Version : 4.3.3
iOS : iOS 4.3 Simulator

jay
  • 3,517
  • 5
  • 26
  • 44

1 Answers1

0

If XMPP requires ARC and you are turning it explicitly off this kind of linker errors happen. Try removing -fno-objc-arc from XMPP files and adding -fobjc-arc in your Other Linker Flags of your project. More info

Community
  • 1
  • 1
Engin Kurutepe
  • 6,719
  • 3
  • 34
  • 64
  • Sorry, I had already added -fobjc-arc against all XMPP files. But the issue persists – jay Jan 28 '13 at 10:43
  • But that's a compile time step, not link time, right?. If I understand correctly, your project is non-ARC so ARC libs are not linked with by default. If some of your classes do require ARC, you need to explicitly link against them. – Engin Kurutepe Jan 28 '13 at 11:17