2012-03-30 50 views
0

需要從iOS爲不同的字符串生成QR碼。試過以下庫:iOS-QR-Code-Generator鏈接問題

**jverkoey-ObjQREncoder-e1841fe** 

能夠生成QR碼..但此代碼不能被任何讀者讀取。

**iOS-QR-Code-Generator** 

按照提供的文檔,但面對,當我試圖加入「kuapay-IOS-QR碼生成器」生成QR碼的連接問題。我遵循寫在github項目中的方式

「要從此模板構建您自己的項目,您必須將libz.dylib庫加載到Xcode中的目標中,還必須將QRDraw和libpng文件夾文件拖動到您的項目,更新Header Search路徑以查看目標版本設置菜單中的libpng文件夾。「

但它給我6錯誤信息。這些是 -

Undefined symbols for architecture i386: 
    "CQR_Encode::EncodeData(int, int, bool, int, char*, int)", referenced from: 
     -[RootViewController LoadQRImage] in RootViewController.o 
    "CQR_Encode::~CQR_Encode()", referenced from: 
     -[RootViewController LoadQRImage] in RootViewController.o 
    "_OBJC_CLASS_$_FileManager", referenced from: 
     objc-class-ref in RootViewController.o 
    "QRDrawPNG::draw(char*, int, int, unsigned char (*) [177], void*)", referenced from: 
     -[RootViewController LoadQRImage] in RootViewController.o 
    "CQR_Encode::CQR_Encode()", referenced from: 
     -[RootViewController LoadQRImage] in RootViewController.o 
    "vtable for QRDrawPNG", referenced from: 
     QRDrawPNG::QRDrawPNG() in RootViewController.o 
    NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

任何人都可以幫助我嗎?或者爲iOS設備建議更好的QR碼生成器? 非常感謝!

回答

0

此問題是由於您在您的應用中無聲使用C++代碼導致的,請在您的RootViewController中使用.mm而不是.m

+0

HI Sharon,試過這個......但沒有運氣:( – 2012-04-02 04:09:25

+0

檢查你是否在你的項目中添加了所有必需的框架和庫以及目標依賴關係,我認爲你缺少QuartzCore.Framework或「libqrencoder.a」庫和檢查目標依賴關係你有你的項目中的「qrencoder」 – 2012-04-02 06:00:19

+0

好的,我發現當我在同一個項目中使用kuapay_iOS-QR-Code-Generator和zxing解碼器代碼時,問題就在發生。發送給你的項目或共享它的唯一方法是github? – 2012-04-02 18:17:07

0

檢查您的文件Barcode.mm,qr_draw_png.mm,QR_Encode.mm鏈接到您的項目目標。你也可以添加「-fno-objc-arc」標誌。