Build error after switching to ARC

Hi all

Must be making some stupid mistake here ...

I just converted an ios project targeted to 4.0 to clang using ARC. It builds and runs fine under xcode but when trying to compile with idea I get:

/Developer/usr/bin/xcodebuild -project CardBox.xcodeproj -target CardBox -configuration Debug -sdk iphonesimulator4.3 SYMROOT=/Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products OBJROOT=/Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Intermediates ARCHS=i386 VALID_ARCHS=i386 ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=NO build
Build settings from command line:
    ARCHS = i386
    OBJROOT = /Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Intermediates
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator4.3
    SYMROOT = /Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products
    TEST_AFTER_BUILD = NO
    VALID_ARCHS = i386


2011-12-11 13:37:50.884 xcodebuild[2044:903] [MT] IDELogStore: Failed to open Build log store: Error Domain=IDEFoundationErrorDomain Code=1 UserInfo=0x200775640 "deserialization of log failed because of a version number mismatch". User info: {
    NSFilePath = "/Users/daniel/Library/Developer/Xcode/DerivedData/CardBox-esxtxgdngnozscfkjwvgvqpburot/Logs/Build/BFD117F0-557F-44E2-B0F5-06AE3F491971.xcactivitylog";
    NSLocalizedDescription = "deserialization of log failed because of a version number mismatch";
}.
=== BUILD NATIVE TARGET CardBox OF PROJECT CardBox WITH CONFIGURATION Debug ===
Check dependencies


Ld /Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products/Debug-iphonesimulator/CardBox.app/CardBox normal i386
    cd /Users/daniel/Source/IPhone/CardBox
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products/Debug-iphonesimulator -F/Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products/Debug-iphonesimulator -filelist /Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Intermediates/CardBox.build/Debug-iphonesimulator/CardBox.build/Objects-normal/i386/CardBox.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -framework QuartzCore -framework CoreData -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products/Debug-iphonesimulator/CardBox.app/CardBox
Undefined symbols for architecture i386:
  "_objc_retain", referenced from:
      +[__ARCLite__ load] in libarclite_iphonesimulator.a(arclite.o)
      -[CardBoxAppDelegate application:didFinishLaunchingWithOptions:] in CardBoxAppDelegate.o
      -[CardBoxAppDelegate applicationDidBecomeActive:] in CardBoxAppDelegate.o
      -[CardBoxAppDelegate applicationWillTerminate:] in CardBoxAppDelegate.o
      +[ManagedContextHolder createObject:] in ManagedContextHolder.o
      -[EditBoxesRootViewController numberOfSectionsInTableView:] in EditBoxesRootViewController.o
      -[EditBoxesRootViewController tableView:numberOfRowsInSection:] in EditBoxesRootViewController.o
      ...
     (maybe you meant: _objc_retainedObject)
  "_objc_retainAutoreleasedReturnValue", referenced from:
      -[CardBoxAppDelegate application:didFinishLaunchingWithOptions:] in CardBoxAppDelegate.o
      +[ManagedContextHolder initializeContext] in ManagedContextHolder.o
      +[ManagedContextHolder releaseContext] in ManagedContextHolder.o
      +[ManagedContextHolder saveContext] in ManagedContextHolder.o
      +[ManagedContextHolder createObject:] in ManagedContextHolder.o
      -[ManagedContextHolder managedObjectModel] in ManagedContextHolder.o
      -[ManagedContextHolder persistentStoreCoordinator] in ManagedContextHolder.o
      ...
  "_objc_release", referenced from:
      -[CardBoxAppDelegate application:didFinishLaunchingWithOptions:] in CardBoxAppDelegate.o
      -[CardBoxAppDelegate applicationDidBecomeActive:] in CardBoxAppDelegate.o
      -[CardBoxAppDelegate applicationWillTerminate:] in CardBoxAppDelegate.o
      +[ManagedContextHolder initializeContext] in ManagedContextHolder.o
      +[ManagedContextHolder releaseContext] in ManagedContextHolder.o
      +[ManagedContextHolder saveContext] in ManagedContextHolder.o
      +[ManagedContextHolder createObject:] in ManagedContextHolder.o
      ...
  "_objc_storeStrong", referenced from:
      -[CardBoxAppDelegate .cxx_destruct] in CardBoxAppDelegate.o
      +[ManagedContextHolder releaseContext] in ManagedContextHolder.o
      +[ManagedContextHolder saveContext] in ManagedContextHolder.o
      -[ManagedContextHolder persistentStoreCoordinator] in ManagedContextHolder.o
      -[ManagedContextHolder .cxx_destruct] in ManagedContextHolder.o
      -[EditBoxesRootViewController fetchedResultsController] in EditBoxesRootViewController.o
      -[EditBoxesRootViewController .cxx_destruct] in EditBoxesRootViewController.o
      ...
  "_objc_autoreleaseReturnValue", referenced from:
      +[ManagedContextHolder createObject:] in ManagedContextHolder.o
      -[EditBoxesRootViewController tableView:cellForRowAtIndexPath:] in EditBoxesRootViewController.o
      -[EditBoxesRootViewController fetchedResultsController] in EditBoxesRootViewController.o
      -[CardsListViewController fetchedResultsController] in CardsListViewController.o
      -[CardsListViewController tableView:cellForRowAtIndexPath:] in CardsListViewController.o
      -[CardsListViewController tableView:titleForHeaderInSection:] in CardsListViewController.o
      -[LearnCardsViewController getNextCard] in LearnCardsViewController.o
      ...
  "_objc_retainAutoreleaseReturnValue", referenced from:
      -[ManagedContextHolder managedObjectModel] in ManagedContextHolder.o
      -[ManagedContextHolder persistentStoreCoordinator] in ManagedContextHolder.o
      -[ManagedContextHolder managedObjectContext] in ManagedContextHolder.o
      -[CardViewController activeTextView] in CardViewController.o
      -[NavigationBar navigationController] in NavigationBar.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)




** BUILD FAILED **




The following build commands failed:
 Ld /Users/daniel/Library/Caches/appCode10/DerivedData/CardBox-459c362b/Build/Products/Debug-iphonesimulator/CardBox.app/CardBox normal i386
(1 failure)

0
2 comments

Does performing 'clean' first solve the problem?

0

Thanks for the follow up.

Nope clean didn't help. I also tried removing appcode caches. No luck.

In the end I worked around it by creating a new project and re-integration my sources. So that was no big problem.

I created a stripped down version of the project which still shows the problem and created http://youtrack.jetbrains.net/issue/OC-2642 just in case someone cares to look into that.

But as I said no big problem.

0

Please sign in to leave a comment.