# Libdl.find\_library does not find library in current directory

**URL:** <https://discourse.julialang.org/t/libdl-find-library-does-not-find-library-in-current-directory/22310>\
**Category:** General Usage\
**Created:** [March 25, 2019, 3:52pm UTC](https://discourse.julialang.org/t/libdl-find-library-does-not-find-library-in-current-directory/22310 "2019-03-25T15:52:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedrohnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pedrohnv/32/212503_2.png) [@pedrohnv](https://discourse.julialang.org/u/pedrohnv)\
**Post date:** [March 25, 2019, 3:52pm UTC](https://discourse.julialang.org/t/libdl-find-library-does-not-find-library-in-current-directory/22310/1 "2019-03-25T15:52:31Z")

</div>

For some reason Julia 1.1.0 can no longer find my shared library (written in C, compiled with MinGW gcc) on Windows 10 (64-bit).  
The commands I use are

```julia
cd("mydir")
run(`ls mylib.dll`) # is the lib in my current folder?
    #outputs: mylib.dll
    #outputs: Process(`ls mylib.dll`, ProcessExited(0))
using Libdl
find_library("mylib.dll", [pwd()])
    #outputs: ""

```

By the last output, Julia can’t find the library even though it is in the working directory.

This worked before but stopped after a crash while using Atom where I had to reinstall the julia-client package. I do not know if that is related

I tried to reinstall Julia, but nothing has changed.

What other steps could I take to debug why is my library not being found?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [March 25, 2019, 6:49pm UTC](https://discourse.julialang.org/t/libdl-find-library-does-not-find-library-in-current-directory/22310/2 "2019-03-25T18:49:44Z")

</div>

What happens if you do:

```julia
dlopen(joinpath(pwd(), "mylib.dll"))

```

(since this is what `find_library` does internally to check whether the library exists in the path you specify)?

---

<div class="post-metadata">

**Author:** ![pedrohnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pedrohnv/32/212503_2.png) [@pedrohnv](https://discourse.julialang.org/u/pedrohnv)\
**Post date:** [March 25, 2019, 8:57pm UTC](https://discourse.julialang.org/t/libdl-find-library-does-not-find-library-in-current-directory/22310/3 "2019-03-25T20:57:29Z")

</div>

It gives an `ERROR: could not load library`

```julia
Stacktrace:
 [1] #dlopen#3(::Bool, ::Function, ::String, ::UInt32) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Libdl\src\Libdl.jl:109
 [2] dlopen at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Libdl\src\Libdl.jl:109 [inlined] (repeats 2 times)
 [3] top-level scope at none:0

```

I do not understand why the pathing to cygwin. I installed Julia using the `julia-1.1.0-win64.exe` file, without touching cygwin (which is in a folder named `cygwin64`).
