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

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?

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

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?

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.

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

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

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.

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

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