zxing/cpp
smparkes@smparkes.net a3228a81a8 C++ for r2690
git-svn-id: https://zxing.googlecode.com/svn/trunk@2691 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2013-04-25 19:49:15 +00:00
..
cli/src Merge schulzch VS support and other cleanup 2013-04-14 23:32:38 +00:00
cmake Merge schulzch VS support and other cleanup 2013-04-14 23:32:38 +00:00
core C++ for r2690 2013-04-25 19:49:15 +00:00
ios.xcodeproj iOS 6 beta xcode tweaks and minor fixes detected by new clang 2012-06-21 20:34:52 +00:00
osx.xcodeproj ahti333's port of aztec and gfpoly + some fixes + Xcode tweaks for recent ECI updates 2012-02-18 02:14:45 +00:00
scons Tweak svn/git ignores 2010-08-20 00:41:26 +00:00
zxing-cpp.xcodeproj xcode project file udpates and a portability fix 2013-04-21 15:48:21 +00:00
.gdbinit 1d complete; tests pass; need to valgrind 2013-04-01 06:00:11 +00:00
.gitignore 1d support for most C++ decoders; n.b. not pdf417 and rss 2013-04-01 06:00:29 +00:00
.svnignore C++ port: 2009-12-08 21:16:43 +00:00
.valgrind.supp fix c++ matrix parsing; closes Issue 1464 2013-04-01 06:01:32 +00:00
.valgrindrc minor C++ build tweaks 2011-10-14 12:34:33 +00:00
blackboxtest.results fix incorrectly applied java port in j2239 2012-06-27 16:02:48 +00:00
blackboxtest.sh some cleanup of the old magick stuff to make diffing with the new stuff easier 2013-04-09 04:53:28 +00:00
CMakeLists.txt make VC++ happy with pdf417 2013-04-21 13:48:42 +00:00
format Many changes to the C++ port. 2009-11-01 17:30:30 +00:00
ios_Prefix.pch objective c port for iOS and OS X 2011-05-17 02:07:56 +00:00
README.md Merge schulzch VS support and other cleanup 2013-04-14 23:32:38 +00:00
SConscript pdf417 patch sans vs tweaks 2013-04-21 02:47:42 +00:00
SConstruct Many changes to the C++ port. 2009-11-01 17:30:30 +00:00

ZXing C++ Port

This is a manual port of ZXing to C++. It has been tested on Linux, Mac OS X and Windows.

Building using SCons

SCons is a build tool written in Python. You'll need to have Python installed, but scons installation is optional: a run time copy of SCons (called scons-local) is included. To use the included copy, replace scons with python scons/scons.py in the instructions below.

To build the library only:

  1. Install libiconv (optional; included in many operating systems)
  2. cd to the cpp folder
  3. Run scons lib

To build the command line utility utility:

  1. Run scons zxing
  2. Run build/zxing for a command line reference

To build the unit tests (optional):

  1. Install CppUnit (libcppunit-dev on Ubuntu)
  2. Run scons tests
  3. Run build/testrunner

To clean:

  1. Run scons -c all

Building using CMake

CMake is a tool, that generates native makefiles and workspaces. It integrates well with a number of IDEs including Qt Creator and Visual Studio.

Usage with Qt Creator:

  1. Open CMakeLists.txt as new project
  2. Specify command line arguments (see below) and press Finish

Usage with Makefiles, Visual Studio, etc. (see cmake --help for a complete list of generators):

  1. cd to cpp/build
  2. Unix: run cmake -G "Unix Makefiles" ..
  3. Windows: run cmake -G "Visual Studio 10" ..

You can switch between build modes by specifying:

  • -DCMAKE_BUILD_TYPE=Debug or
  • -DCMAKE_BUILD_TYPE=Release

Development tips

To profile the code (very useful to optimize the code):

  1. Install Valgrind
  2. Run valgrind --tool=callgrind build/zxing - path/to/test/data/*.jpg > report.html
  3. Analyze output using KCachegrind

To run the black box tests and check for changes:

  1. Build zxing-img, e.g., scons zxing
  2. Run the tests: bash blackboxtest.sh 2>&1 | tee bb.results
  3. Diff them with the known results: diff bb.results blackboxtest.results