Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3    Statistic    FMM    Blog  


Loads the zbar library.

Component Version macOS Windows Linux Server iOS SDK
Barcode 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Barcode.LoadLibrary"; Path )   More


Parameter Description Example
Path Native file path to the library.
A dylib on macOS, a DLL file on Windows and a shard object on Linux wiht so extension.


Returns OK or error.


Loads the zbar library.
Our Barcode.Scan function uses the open source zbar library. Since this library is licensed under LGPL, we can't embed it within the plugin, but you can ship it with your solution, either as a file you install with the plugin or as a file you store in a container and then export to a temp folder.

We have libraries for you here:


Load the zbar library on macOS:

MBS( "Barcode.LoadLibrary"; "/Users/cs/Desktop/zbar/libzbar.0.dylib" )

Load the zbar library on Linux:

MBS( "Barcode.LoadLibrary"; "/usr/lib/x86_64-linux-gnu/" )

// needs to install package on Linux:
// sudo apt-get install libzbar0

If [ MBS("IsWindows") ]
    # you may need to download zbar from our Libs folder or get your own
    # our copy of the library has a dependency, so we load libiconv first
    Set Variable [ $path ; Value: "C:\Users\Christian\Desktop\libiconv.dll" ]
    Set Variable [ $r ; Value: MBS( "Process.LoadLibrary"; $Path ) ]
    # now we can load zbar dll
    Set Variable [ $path ; Value: "C:\Users\Christian\Desktop\libzbar64-0.dll" ]
Else If [ MBS("isMacOS") ]
    # you may need to download zbar from our Libs folder or get your own
    Set Variable [ $path ; Value: "/Users/cs/Desktop/zbar/libzbar.0.dylib" ]
Else If [ MBS("isLinux") ]
    # you may need to install first: sudo apt-get install libzbar0
    Set Variable [ $path ; Value: "/usr/lib/x86_64-linux-gnu/" ]
    Show Custom Dialog [ "Unsupported platform" ; "No library coded for this platform or no MBS Plugin installed." ]
    Halt Script
End If
# load zbar
Set Variable [ $r ; Value: MBS("Barcode.LoadLibrary"; $path) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to load library" ; $r ]
End If

See also

Release notes

  • Version 11.3
    • Added zbar library support to better detect barcodes with Barcode.LoadLibrary and Barcode.Scan functions.

Blog Entries

Created 23th May 2021, last changed 2nd June 2021

Barcode.LibVersion - Barcode.Modulo10Checksum

Feedback: Report problem or ask question.

MBS Xojo blog

Start Chat