nlopt
nlopt copied to clipboard
NLOPT-Windows11-Invalid MEX-file: The specified module could not be found
My issue is similar to 377. However, the DLL files lost in his case have already been downloaded to my computer.
Dependency walker tells me it cannot find LIBMEX.DLL, LIBMX.DLL, and WPAXHOCDER.DLL.
The first two DLL files have already been on my computer. I wonder whether wpaxholder.dll is essential to run Mex file?
- My machine
-
- Win 11 system
-
- Matlab R2020b
-
- MinGW64 Compiler (C++)
-
- I also installed VS 2017, which is 32 bit. I don't know whether it is used in the make process.
Installation steps: (I follow here)
- install mingw64 and add it into enviromental path;
- download nlopt v2.7.1.tar.gz and unzipped it;
cmdto the unpacked directory:
mkdir build
cd build
cmake -G"MinGW Makefiles" ..
mingw32-make
cmd (admin)into\builddirectory:mingw32-make install- Nlopt will be installed in
C:\Program Files(x86).
Now, I copy the installed file to desktop and run the test.m example in official website.
However, the error comes:
Invalid MEX-file 'C:\Users\hemin\Desktop\hehemin\nlopt\lib\matlab\nlopt_optimize.mexw64': The
specified procedure could not be found.
Error in test (line 11)
[xopt, fmin, retcode] = nlopt_optimize(opt, [1.234 5.678]);
To figure out the DLL files needed, I use the dependency walker. After ignoring DLL files starting with 'API-' and 'EXT-', only three files are found lost in my computer:
- LIBMEX.DLL
- LIBMX.DLL
- WPAXHOCDER.DLL. The first two files were already on my computer. The third is a little tricky. It is a system DLL file. Does this file really matter in run mex?
One more question:
In the destinational directory of installation C:\Program Files(x86)\nlopt\lib\matlab, the size of nlopt_optimize.mexw64 is 111KB.
However, in the source directory, C:\Users\hemin\Downloads\nlopt\src\octave, the size of nlopt_optimize.mexw64 is 20KB. Here, I use the C file in this directory to generate mexw64 file.
Why do these two files have different sizes?
One more sentence: no matter which file I use, it cannot work well with test.m. The errors are the same: Invalid MEX-file: The specified procedure could not be found.