As replied in the other thread, you need to use Declares in order to call the functions from the Library. To know what the functions are, you need to have access to the “.h” or header file for the library or, preferably, the documentation provided from the vendor to programming languages like C or Objective-C, for example.
Once you have these resources, you can find some examples about how to use the Declare in the Example Projects > Advanced > Declares folder from the Xojo main Folder for macOS.
Did you import the dylib?
If not:
Insert a Copy Files Build Step to each appropriate platform.
Drag the dylib from your hard disk into the build step (into the place where usually the code editor resides)
In Inspector, make sure behavior applies to both build steps debug and release , and set the destination to the framework folder.
Afterwards, if the declare is right, it should work when you call it: Put a line
Hi hans, after declaring the function you should be able to use it from the Xojo Code. I mean:
Soft Declare Function Open Lib "Libad4.dylib"() As Boolean
Dim b as boolean = Open
In case that the function name from the library is confuse or it collides with anyone used in the Xojo language itself, then you should use the Alias option in the Declare to differentiate it. For example:
Soft Declare Function Open Lib "Libad4.dylib" Alias Open_From_Lib () As Boolean
Dim b as boolean = Open_From_Lib
Javier