Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined symbols for architecture armv7, ld: symbol(s) not found for architecture armv7 - what to do?

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.

like image 335
sooper Avatar asked Apr 19 '12 20:04

sooper


1 Answers

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

like image 124
Grady Player Avatar answered Sep 27 '22 17:09

Grady Player