Build a command line barcode reader in Swift and C on Linux.
- Swift 4.0
- Ubuntu 14.04
- Dynamsoft Barcode Reader SDK 5.2 for Linux.
-
Copy libDynamsoftBarcodeReaderx64.so to /usr/lib/:
sudo cp <Your PATH>/libDynamsoftBarcodeReaderx64.so /usr/lib/libDynamsoftBarcodeReader.so
-
Compile C file with gcc:
gcc -c dbr.c
-
Compile Swift file with swiftc:
swiftc -import-objc-header dbr.h barcode.swift dbr.o -o barcode -lDynamsoftBarcodeReader
-
Run the test app:
./barcode test.tif