C++ SDK - Installation

About the barKoder SDK for C++ #

Architecture #

Multi-platform support: arm32, arm64, x86, x86_64

Regular libs + OCR-enabled libs (with ONNX runtime)

Both static (.a) and shared (.so) libraries

Key Features #

Supports 40+ barcode formats (QR, Code128, PDF417, UPC/EAN, Aztec, etc.) 

ID document scanning capabilities (MRZ, pictures, signatures) 

Sync/async decoding with callback support 

 VIN validation Configurable decoding parameters per format

Building a sample app #

1. Make sure system libraries are installed: #

Debian/Ubuntu

                sudo apt update
sudo apt install libcurl4-openssl-dev libjpeg-dev libpng-dev
            

CentOS / RHEL / AlmaLinux / Rocky Linux

                sudo yum install libcurl-devel libjpeg-turbo-devel libpng-devel
            

Note: Like Debian, libiconv is part of glibc. If you explicitly need GNU libiconv for compatibility, you can build it from source:

                sudo yum install libiconv
# (If not in repos, download from https://ftp.gnu.org/pub/gnu/libiconv/ and compile)
            

Fedora

                sudo dnf install libcurl-devel libjpeg-turbo-devel libpng-devel
            

2. Copy desired architecture shared library file #

The files are placed in the libs folder. You should copy the (.so) files to the system library folder, or into project folder with adjusting LD_LIBRARY_PATH  (and LIBRARY_PATH if needed).

Note that building application with using static lib is not officially supported but you may use it on your own risk.


3. Place vlid trial or production key in Config::InitializeWithLicenseKey function #

                using namespace NSBarkoder;
ConfigResponse response = Config::InitializeWithLicenseKey("Put valid license key here");
            


4. Adjust decoder configuration settings #

As desired (activate barcode types, decoding speed, individual barcode type parameters...)

                  Config *config = response.GetConfig();

  Barcode Types & Decode Speed:
  // Set decode speed
  config->decodingSpeed = NSBarkoder::DecodingSpeed::Rigorous; // Most robust but slower
  // Options: Fast, Normal, Slow, Rigorous

  // Enable specific decoders
  config->SetEnabledDecoders(std::vector<DecoderType>{
      DecoderType::Datamatrix,
      DecoderType::PDF417,
      DecoderType::QR,
      DecoderType::Code128,
      DecoderType::UpcA,
      DecoderType::Ean13
      // ... add others as needed
  });

  // Other configuration examples from sample
  config->maximumResultsCount = 100;
  config->upcEanDeblur = 1; // Enhanced UPC/EAN decoding
  config->code11.checksumType = Code11Config::ChecksumType::Single;

            

5. Run build script buildSample.sh 5.1 #

Optionally, app can be built without jpg and png libraries, in which case you need to remove them from the build script, and also to remove their definitions from the beginning of Sample.cpp, but in that case only BMP image types can be read.

6. Run the application with specifying image file name as first (and only) argument #

Building with OCR (MRZ) support (in addition to previous steps):

  • use libs_ocr source path for libraries with OCR (MRZ) support (only 64 bit platforms are supported)
  • copy files from OCR_Resources to executable folder
  • make sure to use key with MRZ enabled, otherwise decoder won't return even masked result


Note:

Input image format is limited to 24bit BMP, which is supported by Cimg.h. For more image types it's necessary to implement separate loaders using different system or third party libraries.


Page Contents

History:

close

Version #1164

Published: 08/13/2025 06:20:35

Created On: 08/13/2025 06:20:35

Modified By: Vladimir Lazarevski

Published Version

Version #1130

Was Published: 08/12/2025 08:03:13

Created On: 08/12/2025 08:03:13

Modified By: Vladimir Lazarevski

Version #1129

Was Published: 08/12/2025 08:01:36

Created On: 08/12/2025 08:01:36

Modified By: Vladimir Lazarevski

Version #1128

Was Published: 08/12/2025 07:59:23

Created On: 08/12/2025 07:59:23

Modified By: Vladimir Lazarevski

Version #1127

Was Published: 08/12/2025 07:56:03

Created On: 08/12/2025 07:56:03

Modified By: Vladimir Lazarevski

Version #1126

Was Published: 08/12/2025 07:29:55

Created On: 08/12/2025 07:29:55

Modified By: Vladimir Lazarevski

Version #1125

Was Published: 08/12/2025 07:29:35

Created On: 08/12/2025 07:29:35

Modified By: Vladimir Lazarevski

Version #1124

Was Published: 08/12/2025 07:29:13

Created On: 08/12/2025 07:29:13

Modified By: Vladimir Lazarevski

Version #1004

Was Published: 07/28/2025 02:45:40

Created On: 07/28/2025 02:45:40

Modified By: Vladimir Lazarevski

Version #971

Was Published: 04/24/2025 08:56:36

Created On: 04/24/2025 08:56:36

Modified By: Vangel Ivanov

Version #970

Was Published: 04/24/2025 08:55:19

Created On: 04/24/2025 08:55:19

Modified By: Vangel Ivanov

Version #967

Was Published: 04/24/2025 08:09:15

Created On: 04/24/2025 08:09:15

Modified By: Lazar Ilievski

Version #964

Was Published: 04/24/2025 08:01:27

Created On: 04/24/2025 08:01:27

Modified By: Lazar Ilievski

Version #963

Was Published: 04/23/2025 09:56:43

Created On: 04/23/2025 09:56:43

Modified By: Vangel Ivanov

Version #962

Was Published: 08/13/2025 13:58:32

Created On: 04/23/2025 09:51:42

Modified By: Lazar Ilievski

Version #961

Was Published: 08/13/2025 13:58:32

Created On: 04/23/2025 09:50:11

Modified By: Lazar Ilievski

Version #960

Was Published: 04/23/2025 09:49:13

Created On: 04/23/2025 09:49:13

Modified By: Lazar Ilievski