2013-03-18 96 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。這聽起來像你沒有在你的項目中。