我正在尝试在 Xcode 4.4 中尝试新的单元测试(无论如何对我来说都是新的,因为我以前使用过 OHUnit)。
我有几个要添加到目标的类,但其中一个引用了 QuartzCore。
显然我已经将我的单元测试目标链接到 QuartzCore 框架,但它无法运行:
Undefined symbols for architecture armv7s:
"_CGBitmapContextCreateImage", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGContextDrawImage", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGBitmapContextCreate", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGImageGetBitsPerComponent", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGImageRelease", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGContextSetShadowWithColor", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGContextRelease", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGRectZero", referenced from:
-[UIImage(Additions) imageByScalingProportionallyToSize:] in UIImage+Additions.o
"_CGColorSpaceRelease", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
"_CGColorSpaceCreateDeviceRGB", referenced from:
-[UIImage(Additions) imageWithShadow] in UIImage+Additions.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我的构建目标构建成功,但不是单元测试目标。
我尝试创建一个空白的新项目,并添加一个使用 QuartzCore 的文件,但我遇到了同样的问题。
还有其他人经历过这个或有任何有用的建议吗?
谢谢