Skip to content
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

NLOPT-Windows11-Invalid MEX-file: The specified module could not be found #464

Open
hehemin opened this issue Jul 18, 2022 · 1 comment
Open

Comments

@hehemin
Copy link

hehemin commented Jul 18, 2022

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)

  1. install mingw64 and add it into enviromental path;
  2. download nlopt v2.7.1.tar.gz and unzipped it;
  3. cmd to the unpacked directory:
mkdir build
cd build
cmake -G"MinGW Makefiles" ..
mingw32-make
  1. cmd (admin) into \build directory: mingw32-make install
  2. 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:

  1. LIBMEX.DLL
  2. LIBMX.DLL
  3. 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?
@hehemin
Copy link
Author

hehemin commented Jul 19, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant