Build and Run LEADTOOLS Demos on Linux - C/C++

This tutorial shows how to build and run the LEADTOOLS demos on a Linux machine.

Overview  
Summary This tutorial shows how to build and run the LEADTOOLS demos on a Linux machine.
Completion Time 30 minutes
Platform C/C++
IDE Eclipse
Runtime License Download LEADTOOLS
Try it in another language
  • C API: C DLL (Windows)

  • Demo: Demo

Required Knowledge

Before any functionality from the SDK can be leveraged, a valid runtime license will have to be set.

For instructions on how to obtain a runtime license refer to Obtaining a License.

Installing Linux Dependencies

Before attempting to build and run the LEADTOOLS demos on a Linux machine, ensure you have the appropriate dependencies. For information on toolkit dependencies refer to Getting Started with the LEADTOOLS Linux Libraries and Demo Projects.

Build the Demo using Eclipse

In eclipse, go to the File menu and select Import. From the Import dialog, select General and then select Existing Projects into Workspace. Click Next.

Existing Projects into Workspace

In the Import Projects dialog box, select Select root directory and then click Browse. Go to the location where the toolkit is installed (/home/user/LEADTOOLS23), and browse for the demo to be used, click OK, and the click Finish. For the purposes of this tutorial the LEADTOOLS Barcode Demo will be used. After the project is open, press CTRL+B to build the project and generate the Debug64 folder.

Import Projects Dialog Box

Go to Project Explorer, select the imported project, right-click the project, and select Properties, then click Run/Debug Settings -> New -> OK.

Properties

Under the Main tab, enter the location of the C/C++ application that was created.

The Run Configuration Dialog Box

This demo is a console application: as a result, you need to pass the parameters into the Arguments tab from the Run Configuration dialog.

The Run Configuration Arguments Tab

Set a path for the executable to search for the LEADTOOLS libraries at runtime by creating the LD_LIBRARY_PATH in the Environment tab.

The Run Configuration Environment Tab

Using Make

As an alternative to using Eclipse for the C demos, LEAD also ships standalone make files. Perform the following steps to use make files.

Navigate to the LEADTOOLS23/Examples/Common/Linux directory on a terminal. This will build all demos.

Note

The make file sets the rpath for each demo executable to the absolute path of the /home/user/LEADTOOLS23/Bin/Lib/<Platform>. See /home/user/LEADTOOLS23/Examples/Common/Linux/common.mk.

cd ~/LEADTOOLS23/Examples/Common/Linux 
make 

The executable will be built to /home/user/LEADTOOLS23/Bin/Lib/<Platform>. For example, to run the barcode demo use the following command:

../../../Bin/Lib/x64/Barcode -f /home/user/LEADTOOLS23/Resources/Images/barcode1.tif

Run the Demo

Run the project by pressing F11. The console will display the types of barcodes and the values.

Output Example

Wrap-up

This tutorial showed how to build and run LEADTOOLS demos on a Linux machine.

See Also

Help Version 23.0.2024.5.22
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.