3rd_zbar

zbar 3rd party

This 3rd party library is interfaced since ViSP 2.10.0 and is one of the optional 3rd parties supported by ViSP detection modules.

ZBar is an open source software suite for reading bar codes and especially QR codes. ZBar is licensed under the GNU LGPL v2.1 license.

Hereafter we provide installation instructions for the following OS:

 logo-ubuntu-alpha  logo-debian logo-fedora  logo-redhat  logo-apple-alpha  logo-win-alpha
Ubuntu Debian Fedora RedHat OSX Windows

Ubuntu or debian installation

On Linux Debian or Ubuntu, you may install the package with:

sudo apt-get install libzbar-dev

Fedora or RedHat installation

On Fedora or RedHat, you may install the package with yum:

su -c "yum install zbar-devel"

Mac OSX installation

On OSX you may install the package with homebrew:

brew install zbar

Windows installation

From the zbar download page you will find an installer for Windows. We were not able to link the library with ViSP ! It seems that the installer contains a win32 version of the library that produces link errors when ViSP is not build as a win32 project.

If you need to build ViSP as a x64 project, the tip is to build zbar library from source. There is a fork of the library available from GitHub (https://github.com/dani4/ZBarWin64) and adapted for compiling under Visual following the steps:

  • Get ZBarWin64 source code from Github repository. Open a command window and hit:
    C:\> cd C:\workspace
    C:\> git clone https://github.com/dani4/ZBarWin64
  • Open C:\workspace\ZBarWin64\zbar64.sln solution file with Visual Studio C++
  • Select x64 configuration and build zbar library in Release
  • Modify the PATH environment var to add the location of zbar and iconv dll files:
    C:\> setx PATH "%PATH%;C:\workspace\ZBarWin64\x64\Release
    C:\> setx PATH "%PATH%;C:\workspace\ZBarWin64\zbar\libiconv\dll_x64
  • Finaly, to help CMake to detect zbar set ZBAR_DIR environment var:
    C:\> setx ZBAR_DIR "C:\workspace\ZBarWin64
If you want to build zbar from source as a win32 project, the following steps should be adapted:
  • Select win32 configuration and build zbar library in Release
  • Modify the PATH environment var to add the location of zbar and iconv dll files:
    C:\> setx PATH "%PATH%;C:\workspace\ZBarWin64\Release
    C:\> setx PATH "%PATH%;C:\workspace\ZBarWin64\zbar\libiconv\dll_win32

Tips and tricks

If installed in a non common place like /usr or /usr/local, you can set "ZBAR_DIR" environment variable to zbar installation folder location to help the detection of the library during CMake configuration step.

Comments are closed.