iOS-QR-Code-Generator链接问题

时间:2012-03-30 05:14:45

标签: ios qr-code

需要从iOS为不同的字符串生成QR码。试用了以下库:

**jverkoey-ObjQREncoder-e1841fe**

能够生成QR码..但任何读者都无法读取此代码。

**iOS-QR-Code-Generator** 

按照提供的文档但在我尝试添加&kahapay-iOS-QR-Code-Generator时遇到链接问题。生成QRCode。我遵循github项目中编写的方式

"要从此模板构建您自己的项目,您必须在Xcode中将libz.dylib库访问到目标。您还必须将QRDraw和libpng文件夹文件拖到项目中。更新标题搜索路径以查看目标构建设置菜单中的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设备建议更好的QRcode生成器? 非常感谢!

2 个答案:

答案 0 :(得分:0)

导致此问题的原因是您在应用中静默使用c ++代码,请在.mm中使用.m代替RootViewController

答案 1 :(得分:0)

检查您是否有与项目目标相关联的文件Barcode.mm,qr_draw_png.mm,QR_Encode.mm。您也可以添加“-fno-objc-arc”标志。