ubuntu安裝zbar二維碼掃描

世界從而改變發表於2017-03-02
wget http://downloads.sourceforge.NET/project/zbar/zbar/0.10/zbar-0.10.tar.gz
1. tar -zvxf zbar-0.10.tar.gz

2. $ sudo apt-get install libqt4-dev
3. $sudo apt-get install libv4l-dev
4. $ sudo ln -s  /usr/include/libv4l1-videodev.h  /usr/include/linux/videodev.h
5. $ sudo apt-get install python-gtk2-dev
6. $sudo apt-get install imagemagick libmagickwand-dev
7. $sudo apt-get install PHP-pear php5-dev   //如果沒有php5-dev,可以嘗試phpx-dev

a $ export CFLAGS=""
b $ ./configure
c $ make
d $ sudo make install
1 出錯:
    configure: error: in `/home/huazai/user_dir/libdecodeqr/zbar-0.10':
    configure: error: test for video support failed!

    解決:
    $sudo apt-get install libv4l-dev

    $sudo ln -s  /usr/include/libv4l1-videodev.h  /usr/include/linux/videodev.h

2 出錯:
    configure: error: in `/home/huazai/user_dir/zbar/zbar-0.10':
    configure: error: Unable to find ImageMagick >= 6.2.6:

    No package 'MagickWand' found

    解決:
解決問題:        
    1. 安裝 ImageMagick :
     $sudo apt-get install imagemagick libmagickwand-dev

3 執行時出錯
    zbarcam: error while loading shared libraries: libzbar.so.0: cannot open shared object file: No such file or directory

解決問題:
     sudo apt-get install PHP-pear php5-dev

相關文章