---
title: "FindLibrary"
language: "en"
type: "Symbol"
summary: "FindLibrary[lib] finds a dynamic library that can be loaded by LibraryFunctionLoad."
keywords: 
- add external function
- extend functions
- load external library
- MathLink
- dynamic library
- shared library
- DLL
canonical_url: "https://reference.wolfram.com/language/ref/FindLibrary.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Wolfram LibraryLink"
    link: "https://reference.wolfram.com/language/guide/LibraryLink.en.md"
  - 
    title: "C/C++ Language Interface"
    link: "https://reference.wolfram.com/language/guide/CLanguageInterface.en.md"
  - 
    title: "Calling External Programs"
    link: "https://reference.wolfram.com/language/guide/CallingExternalPrograms.en.md"
  - 
    title: "External Operations"
    link: "https://reference.wolfram.com/language/guide/ExternalOperations.en.md"
related_functions: 
  - 
    title: "$LibraryPath"
    link: "https://reference.wolfram.com/language/ref/$LibraryPath.en.md"
  - 
    title: "LibraryFunctionLoad"
    link: "https://reference.wolfram.com/language/ref/LibraryFunctionLoad.en.md"
  - 
    title: "LibraryFunction"
    link: "https://reference.wolfram.com/language/ref/LibraryFunction.en.md"
  - 
    title: "FindFile"
    link: "https://reference.wolfram.com/language/ref/FindFile.en.md"
  - 
    title: "$Path"
    link: "https://reference.wolfram.com/language/ref/$Path.en.md"
related_tutorials: 
  - 
    title: "Library Link User Guide"
    link: "https://reference.wolfram.com/language/LibraryLink/tutorial/Overview.en.md"
  - 
    title: "Library Structure"
    link: "https://reference.wolfram.com/language/LibraryLink/tutorial/LibraryStructure.en.md"
  - 
    title: "Interacting with the Wolfram System"
    link: "https://reference.wolfram.com/language/LibraryLink/tutorial/InteractionWithWolframLanguage.en.md"
---
# FindLibrary

FindLibrary[lib] finds a dynamic library that can be loaded by LibraryFunctionLoad.

## Details

* ``FindLibrary`` can be used to locate both Wolfram Libraries and general dynamic libraries.

* If a relative file name is given, ``FindLibrary`` will use ``\$LibraryPath`` to find the library.

* If no file name extension is given, ``FindLibrary`` will add one appropriate for the current platform: .so on Linux, .dll on Windows, .dylib on Mac OS X.

* ``FindLibrary`` is used by library functions such as ``LibraryFunctionLoad`` to find libraries.

## Examples (1)

### Basic Examples (1)

This finds the sample library called ``demo`` :

```wl
In[1]:= FindLibrary[ "demo"]

Out[1]= "/Applications/Mathematica.app/SystemFiles/Links/LibraryLink/LibraryResources/MacOSX-x86-64/demo.dylib"
```

## See Also

* [`\$LibraryPath`](https://reference.wolfram.com/language/ref/$LibraryPath.en.md)
* [`LibraryFunctionLoad`](https://reference.wolfram.com/language/ref/LibraryFunctionLoad.en.md)
* [`LibraryFunction`](https://reference.wolfram.com/language/ref/LibraryFunction.en.md)
* [`FindFile`](https://reference.wolfram.com/language/ref/FindFile.en.md)
* [`\$Path`](https://reference.wolfram.com/language/ref/$Path.en.md)

## Tech Notes

* [Library Link User Guide](https://reference.wolfram.com/language/LibraryLink/tutorial/Overview.en.md)
* [Library Structure](https://reference.wolfram.com/language/LibraryLink/tutorial/LibraryStructure.en.md)
* [Interacting with the Wolfram System](https://reference.wolfram.com/language/LibraryLink/tutorial/InteractionWithWolframLanguage.en.md)

## Related Guides

* [Wolfram LibraryLink](https://reference.wolfram.com/language/guide/LibraryLink.en.md)
* [C/C++ Language Interface](https://reference.wolfram.com/language/guide/CLanguageInterface.en.md)
* [Calling External Programs](https://reference.wolfram.com/language/guide/CallingExternalPrograms.en.md)
* [External Operations](https://reference.wolfram.com/language/guide/ExternalOperations.en.md)

## History

* [Introduced in 2010 (8.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn80.en.md)