我在我的项目中使用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/SDKs/iPhoneSimulator5。 1.sdk -L / Users / goldfire / Library / Developer / Xcode / DerivedData / WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf / Build / Products / Debug-iphonesimulator -F / Users / goldfire / Library / Developer / Xcode / DerivedData / WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf / Build /产品/调试-iphonesimulator -F /用户/ goldfire /桌面/示例/ WhatsMySpeed -F / Applications / Xcode.app / Contents / Developer / Library / Frameworks -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 -fra mework 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”,引自: _OBJC_CLASS _ $ _ LogicTests在LogicTests.o中 “_OBJC_METACLASS _ $ _ SenTestCase”,引自: _OBJC_METACLASS _ $ _ LogicTests.o中的LogicTests ld:找不到架构i386的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
答案 0 :(得分: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的确切顺序添加项目。