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 |
|
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.
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.
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.
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.
Go to Project Explorer, select the imported project, right-click the project, and select Properties, then click Run/Debug Settings -> New -> OK.
Under the Main tab, enter the location of the C/C++ application that was created.
This demo is a console application: as a result, you need to pass the parameters into the Arguments tab from the Run Configuration dialog.
Set a path for the executable to search for the LEADTOOLS libraries at runtime by creating the LD_LIBRARY_PATH in the Environment tab.
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 project by pressing F11. The console will display the types of barcodes and the values.
This tutorial showed how to build and run LEADTOOLS demos on a Linux machine.