# Libdl.DL\_LOAD\_PATH

**URL:** https://discourse.julialang.org/t/libdl-dl-load-path/16201
**Category:** General Usage
**Created:** [October 11, 2018, 7:05pm UTC](https://discourse.julialang.org/t/libdl-dl-load-path/16201 "2018-10-11T19:05:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ksimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksimon/32/2843_2.png) [@ksimon](https://discourse.julialang.org/u/ksimon)
#### Post date: [October 11, 2018, 7:05pm UTC](https://discourse.julialang.org/t/libdl-dl-load-path/16201/1 "2018-10-11T19:05:01Z")

</div>

Hi Julia community,

I am rewriting my code to move from Julia 0.6x to 1.0 and I stumbled over a little problem and could not find out how to solve it.

I am loading one of my modules ‘MyMod’ and inside one of the module’s functions I have a ‘ccall(…)’ to library ‘mylib’. The library ‘mylib’ is in ‘/path2MyMod/lib/mylib.so’.

Now, when I am at the REPL and type append the path with ‘push!(Libdl.DL\_LOAD\_PATH, “/home/username/Code/path2MyMod/lib”)’ and then call MyMod.functionCCALL(…) everything works fine.

If I append the path within the module (instead of global scope in the REPL) I get an error: Julia tells me that it does not know the library once functionCCALL(…) is called.

My goal is to append to DL\_LOAD\_PATH the absolute library path once the module is imported.

Is there such an option?

Best,  
Konrad

I would like to add

---

<div class="post-metadata">

### Author: ![ksimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksimon/32/2843_2.png) [@ksimon](https://discourse.julialang.org/u/ksimon)
#### Post date: [October 12, 2018, 11:27am UTC](https://discourse.julialang.org/t/libdl-dl-load-path/16201/2 "2018-10-12T11:27:17Z")

</div>

OK, I fixed it myself by simply loading a library pointer using relative paths with ‘Libdl.dlopen()’, then relevant symbols with ‘Libdl.dlsym()’ and then passed these to ‘ccall()’.

This works fine but if there is an idea of how to do it by appending the path to DL\_LOAD\_PATH once the module is loaded I would be happy to hear your opinion 🙂

Cheers,  
Konrad
