Attention: This repository contains the development version of libqrencode. See https://fukuchi.org/works/qrencode/ for the official stable releases. At this moment, the latest stable release is version 4.1.1.
Libqrencode is a fast and compact library for encoding data in a QR Code, a 2D symbology that can be scanned by handy terminals such as a smartphone. The capacity of QR Code is up to 7000 digits or 4000 characters and has high robustness.
Libqrencode accepts a string or a list of data chunks then encodes in a QR Code symbol as a bitmap array. While other QR Code applications generate an image file, using libqrencode allows applications to render QR Code symbols from raw bitmap data directly. This library also contains a command-line utility outputs QR Code images in various formats.
Libqrencode supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. Most of features in the specification are implemented such as:
Currently the following features are not supported:
While the command-line utility and some test programs use libpng or SDL 2.0, the libqrencode library itself has no dependencies. You can skip compiling tests and/or tools if you want not to install programs using SDL or PNG.
If there is no "configure" script in the source code directory, run "autogen.sh" at first to generate it - this is mandatory if you downloaded the source from GitHub. Some additional software is needed to complete this process. For example, in Ubuntu, the following packages are needed:
You can skip this process if you have "configure" script already (typically when you downloaded the source tarball from fukuchi.org.)
Now you are ready to compile the library and tool. Type the following commands:
./configure make sudo make install sudo ldconfig
This compiles and installs the library and header file to the appropriate directories: by default, /usr/local/lib and /usr/local/include. You can change the destination directory by passing some options to the configure script. Run "./configure --help" to see the list of options.
It also installs a command line tool "qrencode" to /usr/local/bin. If you want not to build it, give "--without-tools" option to the configure script.
If the configure script does not work well, try to use CMake.
cmake . make
When you want to build the test programs, give "--with-tests" option to configure, or "-DWITH_TESTS=YES" to cmake.
You can download and install libqrencode using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install libqrencode
The libqrencode port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
Basic usages of this library are written in the header file (qrencode.h). You can generate a manual of the library by using Doxygen, or see
The library is distributed WITHOUT ANY WARRANTY.
Micro QR Code support is EXPERIMENTAL.
Be careful to use the command line tool (qrencode) if it is used by a web application (e.g. CGI script). For example, giving "-s" option with a large number to qrencode may cause DoS. The parameters should be checked by the application.
Copyright (C) 2006-2018 Kentaro Fukuchi
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Visit the homepage at:
for new releases. The git repository is available at:
Please mail any bug reports, suggestions, comments, and questions to:
Kentaro Fukuchi [email protected]
or submit issues to:
QR Code is registered trademarks of DENSO WAVE INCORPORATED in JAPAN and other countries.
Reed-Solomon encoder included in this library is originally taken from FEC library developed by Phil Karn (KA9Q) and distributed under the terms of the GNU LGPL, then rewritten by Kentaro Fukuchi. Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q