我在zxing
应用程序中使用OS X
lib。我已将zxing-objc
包含在我的项目中,只需将zxing demo(zxing-root/objc/examples/demo
)中的代码复制粘贴到单独的ViewController
类中。在尝试编译项目时,我收到以下链接器错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QTCaptureDevice", referenced from:
objc-class-ref in ScanViewController.o
"_OBJC_CLASS_$_ZXCapture", referenced from:
objc-class-ref in ScanViewController.o
"_QTMediaTypeMuxed", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
"_QTMediaTypeVideo", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我仔细检查了所有代码并将我的项目属性(包括c ++编译器选项)与演示项目属性进行了比较,一切都做得很好。
答案 0 :(得分:2)
您需要向应用目标添加必要的框架。您可以在示例应用中查看示例。在Xcode中选择目标,选择Build Phases,然后打开Link With Libraries条目。你会看到它包括QuartzCore和zxing-objc-framework。听起来你的项目中没有那些。