OGeek|极客世界-中国程序员成长平台

标题: ios - 单元测试 Xcode 4 的链接器错误 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 11:34
标题: ios - 单元测试 Xcode 4 的链接器错误

我的应用程序在我运行时构建良好,并且单元测试也构建良好

当我为 CGAffineTransform 添加一些代码时,单元测试失败(应用程序仍然正常)

模拟器和设备的行为相同

错误信息:

Undefined symbols for architecture i386:
  "_CGAffineTransformMakeTranslation", referenced from:
      -[PhysicsObject hasPoint:] in PhysicsObject-23B4A02B8F0621AD.o
  "_CGAffineTransformMakeRotation", referenced from:
      -[PhysicsObject hasPoint:] in PhysicsObject-23B4A02B8F0621AD.o
  "_CGAffineTransformConcat", referenced from:
      -[PhysicsObject hasPoint:] in PhysicsObject-23B4A02B8F0621AD.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试过来自

的建议

http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/ http://sealedabstract.com/code/tired-of-getting-mach-o-linker-errors-when-unit-testing/ Apple Mach-O Linker Error when compiling for device

没有任何效果我怀疑这与一个特别是没有找到的框架有关。我似乎无法确定是哪个。非常感谢帮助。



Best Answer-推荐答案


前缀_CG是CoreGraphics.framework

关于ios - 单元测试 Xcode 4 的链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9227384/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4