2013-03-18 79 views
0

“为架构的x86-x64的未定义符号”我用zxing LIB我OS X应用。我已将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++编译器选项)演示项目属性,一切都做对。

回答

2

您需要将必要的框架添加到您的应用程序目标。您可以查看示例应用程序中的示例。在Xcode中选择目标,选择Build Phases,然后打开Link With Libraries条目。你会发现它包含了QuartzCore和zxing-objc-framework。这听起来像你没有在你的项目中。