Mathlink.jl installation issue on Windows 10

Dear All,

I am trying to install MathLink.jl on Windows 10. I have a full version of Mathematica 12.3, but I do not think it contains any “libML64.dll/ libML32.dll” file as mentioned in ReadMe. The closest is ml64i4.dll located in C:\Program Files\Wolfram Research\Mathematica\12.3\SystemFiles\Links\MathLink\DeveloperKit\Windows-x86-64\SystemAdditions and I set this folder as MathLink dynamic library.

However, after installation when I run using MathLink, I get the error

ERROR: LoadError: could not load library "C:\Program Files\Wolfram Research\Mathematica\12.3\SystemFiles\Links\MathLink\DeveloperKit\Windows-x86-64\SystemAdditions"
The specified module could not be found.
Stacktrace:
 [1] open!(link::MathLink.Link, args::String)
   @ MathLink C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\link.jl:25
 [2] _defaultlink()
   @ MathLink C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\link.jl:51
 [3] #weval#18
   @ C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\eval.jl:52 [inlined]
 [4] weval
   @ C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\eval.jl:52 [inlined]
 [5] #weval#19
   @ C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\eval.jl:53 [inlined]
 [6] weval
   @ C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\eval.jl:53 [inlined]
 [7] parseexpr(str::String)
   @ MathLink C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\eval.jl:63
 [8] var"@W_cmd"(__source__::LineNumberNode, __module__::Module, str::Any)
   @ MathLink C:\Users\shuvo\.julia\packages\MathLink\f5mIR\src\eval.jl:68
in expression starting at REPL[25]:1

Can anyone give me some hints/tips regarding how to work around this issue?

I don’t use MathLink.jl now, but my note when I did use it says

The README of MathLink.jl says to set JULIA_MATHLINK to the path of the library named “libML64.dll/libML32.dll on Windows”, but in my environment I had to set it to the path of ml64i4.dll.

I set the environment variable as follows:

JULIA_MATHKERNEL = C:\Program Files\Wolfram Research\Wolfram Engine\12.0\MathKernel.exe
JULIA_MATHLINK = C:\Program Files\Wolfram Research\Wolfram Engine\12.0\SystemFiles\Links\MathLink\DeveloperKit\Windows-x86-64\SystemAdditions\ml64i4.dll
1 Like

Your solution worked, thanks @genkuroki !