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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM