"i386架构的未定义符号"试图使用iCarousel

Gru*_*kes 3 ios xcode4

我正在尝试使用iCarousel(https://github.com/nicklockwood/iCarousel)并将iCarousel.h和iCarousel.m添加到我的项目中(使用Xcode 4.3.1).

但是在尝试分配iCarousel的实例时,我收到链接器错误(iCarousel继承自UIView):

self.carousel = [[iCarousel alloc]initWithFrame:self.view.bounds];
Run Code Online (Sandbox Code Playgroud)

完整的链接器错误是:

Ld "/Users/Me/Library/Developer/Xcode/DerivedData/IMS-eyffphshuxtblseccxpfluamxudo/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp" normal i386
cd /Users/Me/Desktop/IMS/3.2
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/Me/Library/Developer/Xcode/DerivedData/IMS-eyffphshuxtblseccxpfluamxudo/Build/Products/Debug-iphonesimulator -F/Users/Me/Library/Developer/Xcode/DerivedData/IMS-eyffphshuxtblseccxpfluamxudo/Build/Products/Debug-iphonesimulator -filelist "/Users/Me/Library/Developer/Xcode/DerivedData/IMS-eyffphshuxtblseccxpfluamxudo/Build/Intermediates/IMS.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework AssetsLibrary -framework SystemConfiguration -framework MessageUI -framework EventKit -framework MapKit -framework QuartzCore -framework AddressBook -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/Me/Library/Developer/Xcode/DerivedData/IMS-eyffphshuxtblseccxpfluamxudo/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp"

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_iCarousel", referenced from:
objc-class-ref in IMSCarouselViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

有一些示例项目演示了iCarousel的使用,这些编译很好.我认为我的项目和示例项目之间必定存在一些构建设置差异,但我不知道它们可能是什么,也不知道如何查找.是否有任何技巧可以解密链接器消息以找出问题所在?

(我使用与示例项目中相同的框架/库)

TIA

Mic*_*ann 9

即使您将.h和.m文件添加到项目中,听起来好像它们没有被编译.在File Inspector(项目左侧)中选择iCarousel.m文件,然后在File Inspector中查看"Target Membership"设置.

它看起来像这样(只选择"iCarousel.m"而不是"AppDelegate.m"):

确保为.m文件选择了目标成员资格