zxing 的常见错误

问题一:

Undefined symbols for architecture armv7:

  "_CVPixelBufferLockBaseAddress", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

  "_CVPixelBufferGetBytesPerRow", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

  "_CMSampleBufferGetImageBuffer", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

  "_CVPixelBufferGetWidth", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

  "_CVPixelBufferGetBaseAddress", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

  "_kCVPixelBufferPixelFormatTypeKey", referenced from:

      -[ZXingWidgetController initCapture] in libZXingWidget.a(ZXingWidgetController.o)

  "_CVPixelBufferGetHeight", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

  "_CVPixelBufferUnlockBaseAddress", referenced from:

      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决方法:

 

Have you referenced all the frameworks to the project?

Make sure these frameworks are added:

a. AVFoundation <- This is probably the one which is causing the prob for you. Make sure this is added.

b. AudioToolbox

c. CoreVideo <- This is second culprit. Check if this is added

d. CoreMedia <- This is second culprit as well. Check if this is added

e. libiconv

f. AddressBook

g. AddressBookUI


问题二:
1.使用zxing的方法参考文档http://blog.csdn.net/icash/article/details/7727299。

 

2.如果你项目中使用了zxing,但是在xcdoe升级到4.5以后出现Incompatible pointer types sending 'Class' (aka 'Class *') to parameter of type 'id'错误,解决办法:重新下载更新版本的ZXing, 可以使用命令下载最新版本:svn checkout http://zxing.googlecode.com/svn/trunk/ zxing-read-only。

3.如果出现了问题Undefined symbols for architecture i386"std::string::c_str() const", referenced from。。。。,

将你项目中的Apple LLVM compiler 4.1 - language中的 c Language Dialect、c++ Language Dialect、c++ standard Library设置成下图所选的值。参考http://stackoverflow.com/questions/12665457/zxing-in-xcode-4-5-and-ios-6

 

4.编译成功往真机上装的时候出现Choose a destination with a supported architecture in order to run on this device ,由于ios设备不支持armv7s,所以必须将Architectures设置为armv6,但是仅仅需要改动valid architectures就行,不要改动architectures,否则容易引起真机不运行。把architectures改为$(ARCHS_STANDARD_32_BIT)就可以撞到手机上了。见http://blog.sina.com.cn/s/blog_90a0ad8d01013uuh.html


下载:
https://github.com/zxing/zxing/tree/master/iphone

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值