GHUnit错误文件_OBJC_CLASS _ $ _ SenTestCase“ [英] GHUnit error file _OBJC_CLASS_$_SenTestCase", referenced
问题描述
我在我的项目中使用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/开发人员/平台/ iPhoneSimulator.platform /开发人员/ SDKs / iPhoneSimulator5.1.sdk -L /用户/ goldfire /库/开发人员/ Xcode / DerivedData / WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf /构建/产品/调试iphonesimulator -F /用户/ Library / Developer / Xcode / DerivedData / WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf / Build / Products / Debug-iphonesimulator -F / Users / goldfire / Desktop / Example / WhatsMySpeed -F / Applications / Xcode.app / Contents / Developer / Library / Frameworks-filelist /用户/ goldfire / Library / Developer / Xcode / DerivedData / WhatsMySpeed-amkgqintxyhelabqvrpouivmdglf / Build / Intermediates / WhatsMySpeed.build / Debug-iphonesimulator / GHUnitTests.build / Objects- normal / i386 / GHUnitTests.LinkFileList -mmacosx-version-min = 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 /架构i386的未定义符号:
_OBJC_CLASS _ $ _ SenTestCase,未定义的符号用于表示架构i386的未定义符号:
$ g参考:
_OBJC_CLASS _ $ _ LogicTests在LogicTests.o
_OBJC_METACLASS _ $ _ SenTestCase,引用:
_OBJC_METACLASS _ $ _ LogicTests在LogicTests.o
ld: for architecture i386
clang:error:linker命令失败,退出代码1(使用-v查看调用)
查看此链接:
http://fstanley.github.com/blog/2012/06/10/fixing-ghunit-sentestcase-link-errors/
基本上你需要添加:
$(SDKROOT)/ Developer / Library / Frameworks
/ p>
和
$(DEVELOPER_LIBRARY_DIR)/ Frameworks
我有相同的错误,这个固定的
注意:必须按照完全相同的顺序添加项目, http://forum.sparrow-framework.org/topic/cant-run-unit-tests 。
I'm using GHUnit in my project but when i try to run the app it gives errors
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/Products/Debug-iphonesimulator -F/Users/goldfire/Desktop/Example/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 -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
Undefined symbols for architecture i386: "_OBJC_CLASS_$_SenTestCase", referenced from: _OBJC_CLASS_$_LogicTests in LogicTests.o "_OBJC_METACLASS_$_SenTestCase", referenced from: _OBJC_METACLASS_$_LogicTests in LogicTests.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Check out this link: http://fstanley.github.com/blog/2012/06/10/fixing-ghunit-sentestcase-link-errors/
Basically you need to add:
$(SDKROOT)/Developer/Library/Frameworks
and
$(DEVELOPER_LIBRARY_DIR)/Frameworks
to the framework search paths in the settings for your test target.
I had the same error and this fixed it.
Note: that the items must be added in that exact order, per http://forum.sparrow-framework.org/topic/cant-run-unit-tests.
这篇关于GHUnit错误文件_OBJC_CLASS _ $ _ SenTestCase“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!