# Could not load library "libanco-ratip2013.so" The specified module could not be found

**URL:** <https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415>\
**Category:** General Usage\
**Created:** [March 2, 2020, 3:14pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415 "2020-03-02T15:14:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehran\_Baki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mehran_baki/32/13143_2.png) [@Mehran\_Baki](https://discourse.julialang.org/u/Mehran_Baki)\
**Post date:** [March 2, 2020, 3:14pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/1 "2020-03-02T15:14:22Z")

</div>

I have a problem with opening a library using JuliaPro\_v1.3.1-1 on Windows 10. the error is “could not load library “C:\Users\username.juliapro\JuliaPro\_v1.3.1-1\packages\JAC\ztL1S\deps\bin\libanco-ratip2013.so” The specified module could not be found.”,  
but actually I can see the so-called library in this path.

in REPL:

julia\> using JAC  
ERROR: InitError: could not load library “C:\Users\username.juliapro\JuliaPro\_v1.3.1-1\packages\JAC\ztL1S\src..\deps\bin\libanco-ratip2013.so”  
The specified module could not be found.

Stacktrace:  
[1] #dlopen#3(::Bool, ::typeof(dlopen), ::String, ::UInt32) at C:\Users\julia\AppData\Local\Julia-1.3.1\share\julia\stdlib\v1.3\Libdl\src\Libdl.jl:109  
[2] dlopen at C:\Users\julia\AppData\Local\Julia-1.3.1\share\julia\stdlib\v1.3\Libdl\src\Libdl.jl:109 [inlined] (repeats 2 times)  
[3] **init** () at C:\Users\Mehran.juliapro\JuliaPro\_v1.3.1-1\packages\JAC\ztL1S\src\module-AngularCoefficients-Ratip2013.jl:190  
[4] \_include\_from\_serialized(::String, ::Array{Any,1}) at .\loading.jl:692  
[5] \_require\_search\_from\_serialized(::Base.PkgId, ::String) at .\loading.jl:776  
[6] \_require(::Base.PkgId) at .\loading.jl:1001  
[7] require(::Base.PkgId) at .\loading.jl:922  
[8] require(::Module, ::Symbol) at .\loading.jl:917  
during initialization of module AngularCoefficientsRatip2013

how can I solve this issue since Julia can’t find the library in the address but the library actually exists in the path?

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [March 2, 2020, 4:09pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/2 "2020-03-02T16:09:24Z")

</div>

That’s strange. You are on Windows so it shouldn’t be trying to open a `.so` lib.  
Anyway, those error messages are misleading. What it’s actually complaining is about some missing, or not exported, dependency inside the lib. But, again, it should be trying to read a `.dll`, not a `.so`

---

<div class="post-metadata">

**Author:** ![Mehran\_Baki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mehran_baki/32/13143_2.png) [@Mehran\_Baki](https://discourse.julialang.org/u/Mehran_Baki)\
**Post date:** [March 2, 2020, 4:53pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/3 "2020-03-02T16:53:59Z")

</div>

Thank you for your response. actually I am trying to use and optimize a package entitled “JAC” in windows 10 which developed in ubuntu. when I build “JAC” it calls “make” command to run a bunch of Fortran codes in the first place. there is a “Makefile” like this:

# Assign some variables ONLY if they are not yet defined

FCP ?= gfortran  
FFL ?= -c -O3 -mtune=native -march=native  
BINDIR ?= ../bin

jac\_anco.so : jac\_anco.o  
gfortran -O3 -shared -fPIC -o @ jac\_anco.f90 rabs\_anco.f90 rabs\_angular.f90 rabs\_constant.f90 rabs\_csl.f90 \ rabs\_determinant.f90 rabs\_dirac\_orbital.f90 rabs\_file\_handling.f90 rabs\_functions\_math.f90 \ rabs\_functions\_string.f90 rabs\_grasp92.f90 rabs\_io\_dialog.f90 rabs\_mcp\_adaptation.f90 rabs\_mcp\_grasp92.f \ rabs\_mcp\_mct.f90 rabs\_naglib.f90 rabs\_njgraf.f rabs\_nucleus.f90 rabs\_rcfp.f90 rabs\_recoupling.f90 -o (BINDIR)/libanco-ratip2013.so

.PHONY: clean

clean :  
(RM) (XEXE) \*.o \*.mod

%.o : %.f90  
(FCP) (FFL) $\<

jac\_anco.o : rabs\_anco.o rabs\_mcp\_mct.o

rabs\_anco.o : rabs\_angular.o rabs\_constant.o rabs\_csl.o rabs\_file\_handling.o rabs\_rcfp.o   
rabs\_recoupling.o

rabs\_angular.o : rabs\_constant.o rabs\_dirac\_orbital.o rabs\_functions\_math.o rabs\_io\_dialog.o rabs\_naglib.o

rabs\_constant.o :

rabs\_csl.o : rabs\_constant.o rabs\_determinant.o rabs\_dirac\_orbital.o rabs\_functions\_string.o

rabs\_determinant.o : rabs\_constant.o rabs\_dirac\_orbital.o

rabs\_dirac\_orbital.o : rabs\_constant.o rabs\_functions\_math.o rabs\_naglib.o rabs\_nucleus.o

rabs\_file\_handling.o : rabs\_constant.o rabs\_csl.o rabs\_grasp92.o rabs\_io\_dialog.o rabs\_nucleus.o

rabs\_functions\_math.o : rabs\_constant.o rabs\_naglib.o

rabs\_functions\_string.o : rabs\_constant.o

rabs\_grasp92.o : rabs\_constant.o rabs\_dirac\_orbital.o rabs\_functions\_math.o rabs\_nucleus.o

rabs\_io\_dialog.o : rabs\_constant.o rabs\_functions\_math.o rabs\_functions\_string.o rabs\_nucleus.o

rabs\_mcp\_adaptation.o : rabs\_angular.o rabs\_constant.o rabs\_dirac\_orbital.o rabs\_mcp\_mct.o

rabs\_mcp\_grasp92.o : rabs\_mcp\_adaptation.o rabs\_njgraf.o

rabs\_mcp\_mct.o : rabs\_angular.o rabs\_constant.o rabs\_csl.o

rabs\_naglib.o : rabs\_constant.o

rabs\_njgraf.o :

rabs\_nucleus.o : rabs\_constant.o

rabs\_rcfp.o : rabs\_angular.o rabs\_constant.o rabs\_functions\_string.o

rabs\_recoupling.o : rabs\_angular.o rabs\_constant.o rabs\_csl.o rabs\_rcfp.o

* * *

As you gave me a clue about “.dll” and “.so”, I tried to change the “.so” format into “.dll” format and run “make” command again, so it makes “libanco-ratip2013.dll” instead of “libanco-ratip2013.so” and now I have another error like this:

ERROR: InitError: could not load library “C:\Users\Mehran.juliapro\JuliaPro\_v1.3.1-1\packages\JAC\ztL1S\src..\deps\bin\libanco-ratip2013.dll”  
**%1 is not a valid Win32 application.**

Stacktrace:  
[1] #dlopen#3(::Bool, ::typeof(Libdl.dlopen), ::String, ::UInt32) at C:\Users\julia\AppData\Local\Julia-1.3.1\share\julia\stdlib\v1.3\Libdl\src\Libdl.jl:109  
[2] dlopen at C:\Users\julia\AppData\Local\Julia-1.3.1\share\julia\stdlib\v1.3\Libdl\src\Libdl.jl:109 [inlined] (repeats 2 times)  
[3] **init** () at C:\Users\Mehran.juliapro\JuliaPro\_v1.3.1-1\packages\JAC\ztL1S\src\module-AngularCoefficients-Ratip2013.jl:190  
[4] \_include\_from\_serialized(::String, ::Array{Any,1}) at .\loading.jl:692  
[5] \_require\_from\_serialized(::String) at .\loading.jl:743  
[6] \_require(::Base.PkgId) at .\loading.jl:1034  
[7] require(::Base.PkgId) at .\loading.jl:922  
[8] require(::Module, ::Symbol) at .\loading.jl:917  
during initialization of module AngularCoefficientsRatip2013

* * *

so do I need to make other changes in “Makefile” ? I think “.o” format is an issue here because it is a well known object file in Linux in this case, what do you think? should I change “.o” format to “.obj” in “Makefile” file?

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [March 2, 2020, 5:10pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/4 "2020-03-02T17:10:30Z")

</div>

How (where) are you building the lib? _Makefiles_ don’t normally work on plain Windows, so you must be using some emulation. Cygwin? MinGW? linux?  
I think it should be possible to use MinGW (and even Cygwin and cross-compiling) but I have no experience on that.

**is not a valid Win32 application.** is the key issue. You need to end up with a shared lib that is valid Win32, and that does not depend on Makefile tuning but instead to use a right environment for the building.

---

<div class="post-metadata">

**Author:** ![Mehran\_Baki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mehran_baki/32/13143_2.png) [@Mehran\_Baki](https://discourse.julialang.org/u/Mehran_Baki)\
**Post date:** [March 2, 2020, 5:27pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/5 "2020-03-02T17:27:41Z")

</div>

I am using "MinGW " right now. so how to make the right environment for the building?

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [March 2, 2020, 6:53pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/6 "2020-03-02T18:53:08Z")

</div>

MinGW should be good. Don’t know why it says it’s not a valid Win32.  
Maybe someone else can help.

---

<div class="post-metadata">

**Author:** ![Mehran\_Baki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mehran_baki/32/13143_2.png) [@Mehran\_Baki](https://discourse.julialang.org/u/Mehran_Baki)\
**Post date:** [March 2, 2020, 7:04pm UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/7 "2020-03-02T19:04:51Z")

</div>

I searched a little bit about it and it seems because of Julia’s version. almost every program on my laptop is 64 bit even Julia and somehow MinGW generates 32 bit “.dll” file. I’m trying to install Julia 32 bit and test it again. I will write here if any progress happens.

---

<div class="post-metadata">

**Author:** ![libensvivit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libensvivit/32/19006_2.png) [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Post date:** [May 11, 2020, 2:22am UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/8 "2020-05-11T02:22:16Z")

</div>

I’m having the same problem. @Mehran_Baki do you still get errors after switching to 32 bit?

---

<div class="post-metadata">

**Author:** ![zhubh15](https://avatars.discourse-cdn.com/v4/letter/z/dbc845/32.png) [@zhubh15](https://discourse.julialang.org/u/zhubh15)\
**Post date:** [June 3, 2020, 10:59am UTC](https://discourse.julialang.org/t/could-not-load-library-libanco-ratip2013-so-the-specified-module-could-not-be-found/35415/9 "2020-06-03T10:59:43Z")

</div>

Hi, did you solve your problem? because I have the same issue.
