项目中要用到二维码扫描,在使用中遇到的几个问题记录一下,解决方法均来自于网络
1. 如果是ios 平台 我们只需要保留cpp和iphone这2个文件夹, 对于cpp这个目录,只保留cpp/core/src/zxing下面的内容,其余内容也可以删掉了。
头文件包含的设置:
./zxing/iphone/ZXingWidget/Classes (recursive)
./zxing/cpp/core/src (non-recursive)
2. 添加的lib
a. AVFoundation
b. AudioToolbox
c. CoreVideo
d. CoreMedia
e. libiconv
f. AddressBook
g. AddressBookUI
还有对 ZXingWidget.xcodeproj 设置依赖关系 具体不说了
3. 'iostream' file not found 将包含的文件 改为mm
再Build,报错:Undefined symbols for architecture i386 解决方案:(来自于 http://www.cnblogs.com/dyingbleed/ 李震博客)
自己创建的项目:
TARGETS -> Build Settings -> Apple LLVM compiler 4.1 - Language
设置C++ Standard Library的值为Compiler Default
ZXingWidget项目:
TARGETS -> Build Settings -> Architectures
设置Architectures的值为Standard(armv7, armv7s)