链接器错误与Xcode中的测试

时间:2013-04-25 02:52:24

标签: ios xcode linker-errors

我按照TDD site中使用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)

我尝试查看缺少的源代码或链接库,但找不到任何内容。谁知道还有什么可能是错的?

谢谢!

1 个答案:

答案 0 :(得分:0)

您是否尝试过以下操作:

转到XCode,在项目下 - >干净并再次构建您的解决方案。