WOLFRAM

LibraryFunctionLoad[lib,fun,argtype,rettype]

loads Wolfram Library lib and makes the library function fun available in the Wolfram Language.

Details and Options

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Load a function from a sample library:

Out[1]=1

Call the function:

Out[2]=2

You can call LibraryFunctionLoad more than once for the same input:

Out[3]=3

Load a function from the library, which will exchange data over WSTP:

Out[1]=1
Out[2]=2

Load a function, which calls back to the Wolfram Language to evaluate Message[MyFunction::info]:

Out[2]=2
Out[3]=3

Possible Issues  (1)Common pitfalls and unexpected behavior

LibraryFunctionLoad uses FindLibrary to locate libraries:

Out[1]=1

It is faster to find the library once with FindLibrary:

Out[2]=2
Wolfram Research (2010), LibraryFunctionLoad, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html (updated 2014).
Wolfram Research (2010), LibraryFunctionLoad, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html (updated 2014).

Text

Wolfram Research (2010), LibraryFunctionLoad, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html (updated 2014).

Wolfram Research (2010), LibraryFunctionLoad, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html (updated 2014).

CMS

Wolfram Language. 2010. "LibraryFunctionLoad." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html.

Wolfram Language. 2010. "LibraryFunctionLoad." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html.

APA

Wolfram Language. (2010). LibraryFunctionLoad. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html

Wolfram Language. (2010). LibraryFunctionLoad. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html

BibTeX

@misc{reference.wolfram_2025_libraryfunctionload, author="Wolfram Research", title="{LibraryFunctionLoad}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html}", note=[Accessed: 07-July-2025 ]}

@misc{reference.wolfram_2025_libraryfunctionload, author="Wolfram Research", title="{LibraryFunctionLoad}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html}", note=[Accessed: 07-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_libraryfunctionload, organization={Wolfram Research}, title={LibraryFunctionLoad}, year={2014}, url={https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html}, note=[Accessed: 07-July-2025 ]}

@online{reference.wolfram_2025_libraryfunctionload, organization={Wolfram Research}, title={LibraryFunctionLoad}, year={2014}, url={https://reference.wolfram.com/language/ref/LibraryFunctionLoad.html}, note=[Accessed: 07-July-2025 ]}