linux zbar 编译报错解决记录/usr/include/x86_64-linux-gnu/bits/stdio2.h:143:1: error: expected identifie....

报错信息:

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

首先,在执行./configure时,留意最后输出结果保证正常执行完成,正常完成应该是没有error字符的,例如:

复制代码
...
configure: creating ./config.status config.status: creating Makefile config.status: creating zbar.pc config.status: creating zbar-gtk.pc config.status: creating zbar-qt.pc config.status: creating doc/doxygen.conf config.status: creating include/config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing doc/version.xml commands config.status: executing doc/reldate.xml commands please verify that the detected configuration matches your expectations: ------------------------------------------------------------------------ X --with-x=yes pthreads --enable-pthread=yes v4l --enable-video=no => zbarcam video scanner will *NOT* be built jpeg --with-jpeg=yes Magick++ --with-imagemagick=yes Python --with-python=no GTK+ --with-gtk=yes => the PyGTK widget wrapper will *NOT* be built Qt4 --with-qt=no => the Qt4 widget will *NOT* be built
复制代码

如果报:Unable to find ImageMagick,安装ImageMagick和libmagickwand-dev

apt-get install imagemagick libmagickwand-dev

如果报: error: no suitable Python interpreter found

说明没有python环境或现有python和zbar需要的版本不一致,如果没有涉及到python,添加参数--without-python

如果报:configure: error: test for video support failed!
rebuild your kernel to include video4linux support or
configure --disable-video to skip building video support.

添加--disable-video 参数

例如我的最后执行./configure参数:

./configure FLAGS="" --disable-video --without-python --without-qt

 

posted @   耿明岩  阅读(1380)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!
希望能帮助到你,顺利解决问题! ...G(^_−)☆
点击右上角即可分享
微信分享提示