Result = OpenLibrary(#Library, Filename$)
Opens a shared library in order that the functions within it may be accessed.


#Library A number to identify this library. #PB_Any can be used to auto-generate this number.
Filename$ The filename of the library to load. If the filename does not include a path, then the operating system will search for the library in its system folders, the applications directory and the current directory.

Return value

Returns nonzero if the library was opened successfully and zero if not. If #PB_Any was used as the #Library parameter then the generated number for the library is returned on success.


It's mandatory, that the created PureBasic executable and the shared library are using the same architecture (for example a x86 DLL can't be opened by x64 executables).

See Also

CloseLibrary(), GetFunction(), prototypes

Supported OS


<- NextLibraryFunction() - Library Index