represents a function declaration that exposes the library function extName with the type type from the library lib, for use in compiled code.
aliases the function with name in compiled code.
assumes that the library will be loaded by the time the function is compiled.
- LibraryFunctionDeclaration is a symbolic representation of a declaration and does not evaluate on its own.
- LibraryFunctionDeclaration can be used inside of CompilerEnvironmentAppendTo and the first argument of functions like FunctionCompile.
- If name is not given, LibraryFunction["extName"] is used.
- If the library has not already been loaded, then it will be loaded when a FunctionCompile is called.
- Libraries referenced by LibraryFunctionDeclaration run in the same process as the Wolfram Language kernel.
- FindLibrary is used to locate libraries found on $LibraryPath.
- When interfacing with libraries generated from C, it is preferable to use types such as "CInt" and "CFloat" instead of "Integer32" and "Real32", as the size of C types can vary on some platforms.
- LibraryLoad can be used to manually load a library. Functions from manually loaded libraries can be referenced by LibraryFunctionDeclaration without specifying the library. »
Examplesopen allclose all
Basic Examples (1)
Compare the computed hash with the built-in function Hash:
Wolfram Research (2022), LibraryFunctionDeclaration, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryFunctionDeclaration.html.
Wolfram Language. 2022. "LibraryFunctionDeclaration." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LibraryFunctionDeclaration.html.
Wolfram Language. (2022). LibraryFunctionDeclaration. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LibraryFunctionDeclaration.html