-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DllNotFoundException nlopt_x64.dll #29
Comments
What OS are you running on? And you verified that you're running an x64 build of your C# application? Perhaps there's a dependency missing. You could try |
Ok, I realized my mistake. Since it was looking for nlopt_x64.dll, not nloptNET_x64.dll I thought it was looking for the underlying nlopt library. So I installed it from the nlopt binaries for windows. I now realize that NuGet installed the nloptnet library as nlopt.dll. I renamed it to nlopt_x64.dll and now it works. May I suggest updating the NuGet package to install the library with the correct name? Alternatively, add instructions in the README file. In any case, thank you ever so much for making the .NET interface available. |
Fixed in 1.4.2 |
I NuGet installed NLOptNet and copy/pasted some code from the ReadMe
When I execute the line:
var solver = new NLoptSolver(NLoptAlgorithm.LN_COBYLA, 1, 0.001, 100)
I get the below error
(Note: I am using .NET Framework 4.8. I also downloaded and installed https://github.com/stevengj/NLoptBuilder/releases/download/v2.6.1/NLopt.v2.6.1.x86_64-w64-mingw32.tar.gz and I even copied the libnlopt.dll from its bin directory to my executable directory and renamed it to nlopt_x64.dll.)
System.DllNotFoundException
HResult=0x80131524
Message=Unable to load DLL 'nlopt_x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=NLoptNet
StackTrace:
at NLoptNet.NLoptSolver.nlopt_create64(NLoptAlgorithm algorithm, UInt32 n)
at NLoptNet.NLoptSolver..ctor(NLoptAlgorithm algorithm, UInt32 numVariables, Double relativeStoppingTolerance, Int32 maximumIterations, Nullable`1 childAlgorithm)
The text was updated successfully, but these errors were encountered: