Linux SDK - Installation
Prerequisites #
Before installing, make sure you have the following:
Building sample application: #
Download the latest Linux SDK package from the barKoder Developer Portal or from the link provided by the barKoder team.
1. From the barKoder Developer Portal #
- Open your web browser and go to the barKoder Developer Portal.
- Log in with your developer account credentials.
- Navigate to the Repository section.
- Select barKoder for Linux from the available options.
- Download the latest package (usually a .zip file).
2. Make sure system libraries are installed: #
3. Copy the desired architecture shared library file (.so) #
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).
4. Place vlid trial or production key in Config::InitializeWithLicenseKey function #
using namespace NSBarkoder;
printf("SDK version: %s\n",Barkoder::GetLibVersion().c_str());
//Use valid trial or production key here
ConfigResponse response = Config::InitializeWithLicenseKey("Put valid license key here");
5. Adjust decoder configuration settings #
Config *config = response.GetConfig();
// Configure decoder
config->decodingSpeed = DecodingSpeed::Normal;
config->maximumResultsCount = 10;
// Enable specific decoders
config->SetEnabledDecoders(std::vector<DecoderType>{
DecoderType::Datamatrix,
DecoderType::PDF417,
DecoderType::QR,
DecoderType::Code128,
DecoderType::UpcA,
DecoderType::Ean13
// ... add others as needed
});
6. Run build script buildSample.sh #
Optionally, the app can be built without the jpg and png libraries—this requires removing them from the build script and also removing their definitions from the beginning of Sample.cpp, but in that case, only BMP image types can be read.
7. Run the application #
By specifying image file name as the 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