zbar-0.10 交叉编译

下载地址

http://sourceforge.mirrorservice.org/z/zb/zbar/zbar/0.10/
http://zbar.sourceforge.net/可能由于某些原因,编写这篇文章时无法打开。

编译环境

Ubuntu 18.04.3 LTS

编译配置

假设:

  • 交叉编译工具:arm-linux-
    使用的交叉编译工具版本信息如下:
    Target: arm-linux-gnueabi
    Configured with: --target=arm-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --disable-nls --enable-clocale=gnu --enable-libgomp --disable-libitm --enable-poison-system-directories 
    Thread model: posix
    gcc version 6.3.0 
    
       
       
    • 1
    • 2
    • 3
    • 4
  • 交叉编译结果安装目录:/home/user/cross-compile/

配置及编译:

  1. 设置环境变量:
    export NM=arm-himix200-linux-nm

  2. 设置编译参数:
    ./configure --prefix=/home/user/cross-compile/zbar --host=arm-linux --enable-shared --without-gtk --without-python --without-qt --without-imagemagick --disable-video CC=arm-linux-gcc CXX=arm-linux-g++
    –prefix:指定安装目录
    –host:指定目标主机类型
    –enable-shared:编译生成.so动态库
    –enable-static:编译生成.a静态库

  3. 编译,执行make
    编译ZBar时,可能提示如下错误。

    In file included from /usr/include/stdio.h:937:0,
                  from zbar/debug.h:60,
                  from zbar/scanner.c:34:
    /usr/include/x86_64-linux-gnu/bits/stdio2.h:140:1: error: expected identifier or ‘(’ before ‘{’ token
    
       
       
    • 1
    • 2
    • 3
    • 4

    解决方法:
    export CFLAGS=""
    将CFLAGS环境变量置为空,然后重新 ./configure,再make,则会成功。

  4. 安装编译结果,make install

其他

zxing和zbar的比较,可以参考:https://mp.weixin.qq.com/s/_I8GgmRcuntYlVteSmRRDg

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值