bardecode.com
barcode reading software
  • Home
  • Download
  • Purchase
  • SDK Licensing
  • Pricing
    • Windows SDK Price List
    • Windows SDK with PDF Extension Price List
    • Linux SDK Price List
    • Linux SDK with PDF Extension Price List
    • PDF Extension For Windows Price List
    • Multi-Platform Toolkit for .NET Price List
    • BardecodeFiler Desktop Only Price List
    • BardecodeFiler Windows Service Price List
    • DOS Command Prompt Barcode Tool Price List
    • Terms and Conditions
    • Refund Policy
  • Products
    • Softek Barcode Reader Toolkit for Windows
    • Softek Barcode Reader Toolkit for Linux
    • BardecodeFiler Desktop App
    • BardecodeFiler Windows Service
    • Windows DOS Command Prompt Tool
    • Multi-platform barcode reader toolkit for .NET
    • Aquaforest’s Autobahn DX
  • Knowledge Base
    • Documentation
    • Specifications
  • News
  • Contact
    • About Us
    • Terms and Conditions
    • Resellers
    • Links
Select Page ...

News

Calling the Linux C Library from C++ code

admin February 1, 2019 Knowledge Base, Software Development Kits

Here’s a quick example of how to create and build a simple C++ program that calls the basic Bardecode C library functions…

It’s assumed that you have already downloaded the Linux version of our SDK and are working in the installation folder.

The code:

#include

using namespace std;

extern “C” {
#include “include/barcode.h”
}

int main()
{
void *hBarcode = STCreateBarCodeSession();

char **bartype ;
char **barvalue ;
int n = STReadBarCode(hBarcode, (char *) “images/code39_01.tif”, (char *) “tif”, &barvalue, &bartype);

cout << "Return value = " ; cout << n ; cout << "\n"; if (n > 0)
{
cout << "First barcode value is "; cout << barvalue[0]; cout << "\n"; } return 0 ; } The build (you will have to get the path right for the various libraries - we built this on Ubuntu x64): g++ -o yourcode yourcode.cpp lib/bardecode.a /usr/lib/x86_64-linux-gnu/libtiff.so.5 /usr/lib/x86_64-linux-gnu/libjpeg.so.8 /usr/lib/x86_64-linux-gnu/libpthread.so

← BardecodeFiler Version 2.5.1.1 has been released
Reading binary data from a barcode using Visual C# →
admin

  • Copyright © 2023 Softek Software Ltd. All Rights Reserved