GHUnit错误文件_OBJC_CLASS _ $ _ SenTestCase",引用

Zia*_*mim 3 iphone cocoa-touch ocunit ipad gh-unit

我在我的项目中使用GHUnit,但是当我尝试运行应用程序时,它会出错

Ld /Users/goldfire/Library/Developer/Xcode/DerivedData/WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf/Build/Products/Debug-iphonesimulator/GHUnitTests.app/GHUnitTests normal i386 cd/Users/goldfire/Desktop/Example/WhatsMySpeed 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/软件开发工具包/ iPhoneSimulator5.1.sdk -L /用户/的Goldfire /库/开发商/ Xcode中/ DerivedData/WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf /编译/产品/调试-iphonesimulator -F /用户/的Goldfire /库/开发商/ Xcode中/ DerivedData/WhatsMySpeed- amkgqintxyhelabqvrpouivmdglf/Build/Products/Debug-iphonesimulator -F/Users/goldfire/Desktop/Example/WhatsMySpeed -F/Appl ications/Xcode.app /内容/开发/库/框架-filelist /Users/goldfire/Library/Developer/Xcode/DerivedData/WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf/Build/Intermediates/WhatsMySpeed.build/Debug-iphonesimulator/GHUnitTests.build/Objects- normal/i386/GHUnitTests.LinkFileList -mmacosx-version-min = 10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED = 50100 -framework UIKit -framework Foundation -framework CoreGraphics -framework GHUnitIOS -framework SenTestingKit -o /Users/goldfire/Library/Developer/Xcode/DerivedData/WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf/Build/Products/Debug-iphonesimulator/GHUnitTests.app/GHUnitTests

对于i386硬件架构未定义的符号: "_OBJC_CLASS _ $ _ SenTestCase",从引用:在LogicTests.o "_OBJC_METACLASS _ $ _ SenTestCase" _OBJC_CLASS _ $ _ LogicTests,从引用:在LogicTests.o LD _OBJC_METACLASS _ $ _ LogicTests:符号(S)没有找到i386硬件架构铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)

Rob*_*aff 7

看看这个链接:http: //fstanley.github.com/blog/2012/06/10/fixing-ghunit-sentestcase-link-errors/

基本上你需要添加:

$(SDKROOT)/Developer/Library/Frameworks

$(DEVELOPER_LIBRARY_DIR)/Frameworks

到测试目标设置中的框架搜索路径.

我有同样的错误,这解决了它.

注意:根据http://forum.sparrow-framework.org/topic/cant-run-unit-tests,必须按照确切的顺序添加项目.