繁体   English   中英

Xcode中测试的链接器错误

[英]Linker Error with Tests in Xcode

我按照TDD网站上使用xcode / appcode进行测试的说明进行操作。 我顺利通过了最初的部分,并开始在自己的项目中进行实验,但是我一直遇到链接错误,无法确定从何而来?

我得到的输出是这个

Ld /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator/acidplusTests.octest/acidplusTests normal i386
cd /Volumes/Defiant/Freeradical/freeradical_newacidbase/acidplus
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
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 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator -LLibs/OCMock/iOS -LLibs/OCMock/iOS/OCMock -F/Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Intermediates/acidplus.build/Debug-iphonesimulator/acidplusTests.build/Objects-normal/i386/acidplusTests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -force_load Libs/OCMock/iOS/libOCMock.a -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework CoreGraphics -framework SenTestingKit -framework UIKit -framework Foundation -lOCMock -o /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator/acidplusTests.octest/acidplusTests

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

我尝试查看缺少的“源”或“链接的库”,但找不到任何东西。 有人知道还有什么问题吗?

谢谢!

您是否尝试过以下方法:

转到XCode,在Project下->清理并再次构建解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM