C + + QR Code related library compilation

Source: Internet
Author: User

First, blind thinking

Sitting on the subway idle to bored, suddenly think of the two-dimensional code, handy on the relevant information of Baidu, the current C + + QR code related library is not much, also Zbar (open source China up and down half a day also did not download down), zxing, but these two libraries are said to parse two-dimensional code, can not generate two-dimensional code, , if you are engaged in C # or Java, then congratulations, you can directly use the Zxing library to complete the generation and parsing of the QR code, specifically see

    • C + + generated two-dimensional code summary, this article is mainly summed up under the current two-dimensional code related third-party library, personally feel good. Qzxing is a QT-based package for zxing
    • Zxing implementation of two-dimensional code generation and parsing, Java implementation mode
Two or two-dimensional code generation tool

Here I give you a two-dimensional code generation tool, the effect 1, you can see the two-dimensional code tool name.

Figure 12 Dimension Code display

About two-dimensional code in the middle of the picture, in fact, is affixed to, because the two-dimensional code has fault tolerance, so adding a small picture does not affect the parsing effect. 2, from the installation file to see this open source tool is actually using the zxing library to produce and parse the QR code, this and the previous description of the article discrepancies. Specific zxing whether the production of the two-dimensional code of the individual has not been verified, this article is intended to tell the compilation process of each library, so the problem does not make a conclusion

Figure 2 List of installation files

Third, qzxing compilation

Qzxing is based on QT to encapsulate zxing, then this section I will directly describe the qzxing compilation process.

    1. First download the qzxzing source from the SourceForge.net, and unzip
    2. Convert pro files to sln using the Qmake command (1, qmake Qzxing.pro 2, QMAKE-TP v-r)
    3. Using the VS Open sln file for compilation, eventually generating the associated DLL, LIB, and PDB files, as shown in 3, I only show the files produced under release

Figure 3 Qzxing compilation results

Iv. Compilation of qrencode-3.1.0

Under Windows based on Qrencode can be generated QR code, I refer to a few articles to compile, the article list is as follows:

VS2010 Compiling full libqrencode details

vc2010 compiling Qrencode

The above two articles are about the self-built vs engineering to compile Qrencode source code, but the details are different, which is mainly the qrenc.c file is added to the project, the following compilation steps are I follow the understanding of these two articles in the practice of compiling steps

Compile steps:

    1. Download Qrencode source and unzip it from GitHub
    2. Create a new Win32 project and set the project as Lib library without using precompiled header files
    3. Add all the. h and. C (except QRENC.C) files in the Qrencode Direct directory to the project, where the config.h.in is changed to Config.h and the rscode.c source is modified, and the MODNN function removes the inline keyword
    4. Modify the qrspec.c file to replace StrDup with _strdup, which is not mentioned in 22 articles, I found the solution based on the error, see the POSIX name for this item is deprecated in VC + + 2008
    5. As shown in compilation result 4

Figure 4 Qrencode compilation results

Five, Zbar Code

This library can be downloaded directly on SourceForge.net, contains DLL and lib files, I downloaded the extracted files after 5

Figure 5 Zbar Library

Vi. Use of

The use of these libraries is relatively simple, I am here to give a few people feel that the use of links

    1. libqr--simple and easy to use C + + QR code generation library: LIBQR

    2. using qzxing to identify a picture QR code : qzxing Use
    3. QR code Two-dimensional code introduction and Qrencode Library migration and use: Qrendcode use

Vii. RELATED LINKS

The use and difference of strdup and _strdup

Note: I will add a small example to the use of subsequent time

C + + QR Code related library compilation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.