This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

LibraryFunctionLoad

LibraryFunctionLoad
loads Wolfram Library lib and makes the library function fun available in Mathematica.
liblibrary to be loaded
funfunction name as specified in the library file
argtypeslist of argument types
rettypereturn type
  • Possible argument and return types, and their corresponding C type, include:
True|FalsemboolBoolean
_Integermintmachine integer
_Realdoublemachine double
_Complexmcomplexmachine complex double
{base,rank}MTensortensor of specified base type and rank
"UTF8String"char*string in UTF-8 encoding
LinkObjectMLINKarguments and result passed over MathLink
"Void"voidno result (return only)
  • LibraryFunctionLoad can be called more than once with the same arguments returning the same LibraryFunction object.
  • Libraries loaded by LibraryFunctionLoad must be written as a dynamic library for the platform on which they run.
Load a function from a sample library:
Call the function:
You can call LibraryFunctionLoad more than once for the same input:
Load a function from the library, which will exchange data over MathLink:
Load a function, which calls back to Mathematica to evaluate Message:
Load a function from a sample library:
In[1]:=
Click for copyable input
Out[1]=
Call the function:
In[2]:=
Click for copyable input
Out[2]=
You can call LibraryFunctionLoad more than once for the same input:
In[3]:=
Click for copyable input
Out[3]=
 
Load a function from the library, which will exchange data over MathLink:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Load a function, which calls back to Mathematica to evaluate Message:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
New in 8