ForeignPointerLookup[lib,fun]
returns the pointer to the function fun in the library lib.


ForeignPointerLookup
ForeignPointerLookup[lib,fun]
returns the pointer to the function fun in the library lib.
Details

- ForeignPointerLookup returns an OpaqueRawPointer.
- lib is resolved with FindLibrary.
- lib must be a C-compatible dynamic library.
- ForeignPointerLookup is analogous to dlsym on Unix-type systems, and GetProcAddress on Windows.
Examples
open all close allBasic Examples (1)
Get the pointer to a function in a library:
Load the ForeignFunction by specifying an appropriate type:
Scope (1)
ForeignPointerLookup uses FindLibrary to locate libraries:
Alternatively, find the library once with FindLibrary and pass it to ForeignPointerLookup:
Applications (1)
Properties & Relations (1)
Get the pointer to a function in a library:
Load the ForeignFunction by specifying an appropriate type:
Alternatively, this can be accomplished with a single ForeignFunctionLoad call:
Possible Issues (2)
ForeignPointerLookup will return a Failure if the library cannot be found:

ForeignPointerLookup will return a Failure if the function pointer cannot be found in the library:

Tech Notes
Related Guides
History
Text
Wolfram Research (2023), ForeignPointerLookup, Wolfram Language function, https://reference.wolfram.com/language/ref/ForeignPointerLookup.html.
CMS
Wolfram Language. 2023. "ForeignPointerLookup." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ForeignPointerLookup.html.
APA
Wolfram Language. (2023). ForeignPointerLookup. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ForeignPointerLookup.html
BibTeX
@misc{reference.wolfram_2025_foreignpointerlookup, author="Wolfram Research", title="{ForeignPointerLookup}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/ForeignPointerLookup.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_foreignpointerlookup, organization={Wolfram Research}, title={ForeignPointerLookup}, year={2023}, url={https://reference.wolfram.com/language/ref/ForeignPointerLookup.html}, note=[Accessed: 11-August-2025]}