7

I've read many posts on SO and none of the proposed solutions are working for me. I'm hoping someone who knows a little more about interpreting errors can help.

My app has been working fine (and still does), but I'm having an issue when using a certain class 'iCarousel' which is an implementation of Cover Flow.

Here's the interesting thing: When opening the sample project for the iCarousel, it runs fine on my iPhone. My app (in a separate project) also runs fine. They are both using armv6 armv7 architectures and running on iOS 5.1.

I then copy the class to my own project and add all necessary frameworks. There are no errors yet. But when I build and run I get an error:

Ld /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-
ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/Debug-
iphoneos/TestApp.build/Objects-normal/armv7/TestApp normal armv7

    cd "/Users/Sooper/Developer/TestApp v1.0"
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:
    /Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot 

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
 -L/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Products/
Debug-iphoneos -F/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Products/
Debug-iphoneos -filelist /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/
Debug-iphoneos/TestApp.build/Objects-normal/armv7/TestApp.LinkFileList -dead_strip -miphoneos-
version-min=5.0 -lz -framework QuartzCore -framework CoreGraphics -framework 
SystemConfiguration -lxml2.2.7.3 -framework Security -framework CoreMedia -framework Accounts 
-framework CoreFoundation -framework AudioToolbox -framework AVFoundation -framework Twitter -
framework MediaPlayer -framework UIKit -framework Foundation -o 
/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-
ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/Debug-
iphoneos/TestApp.build/Objects-normal/armv7/TestApp

Under this:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ArtworkScrollerViewController", referenced from:
      objc-class-ref in TestAppViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I remove the instance of the class the error goes away and the app runs. I'm totally confused. Why would it work separately but not in another project?

Would greatly appreciate some guidance.

sooper
  • 5,991
  • 6
  • 40
  • 65

1 Answers1

20

make sure you add ArtworkScrollerViewController.m to the target that you are building

Grady Player
  • 14,399
  • 2
  • 48
  • 76
  • Thanks for the response. How would I add `ArtworkScrollerViewController.m` to the target? Would that be to check 'Target Membership' in the class's info viewer? I've done this but still get the same error. – sooper Apr 19 '12 at 20:25
  • Did clean after and ran again, seemed to fix that. Thanks – sooper Apr 19 '12 at 20:32
  • 4
    @sooper To add it to the target, open up the right side menu in XCode (Utilities) while `ArtworkScrollerViewController.m` is selected. There is a dropdown in the File Inspector called "Target Membership". If you select that, it will add the .m to the target. – RileyE Nov 23 '12 at 21:19
  • 3
    @sooper No worries. I saw it and I figured I could add something to it if anyone stumbles upon it later. I find cleaning gives mixed results. – RileyE Nov 23 '12 at 23:03
  • 1
    @RileyE: And you did well, because some months later, I stumbled upon this and had now idea how to do it until I read your comment. Thank you very much! – Saturn Jan 24 '13 at 22:26
  • @Omega Thats awesome! I'm glad it could help. You're very welcome. – RileyE Jan 24 '13 at 22:28