MEX file error: "The specified module could not be found" on Windows

We periodically get support requests due to “UNEXPECTED ERROR” messages like this on Windows:

   UNEXPECTED ERROR: ------------------------------------------------------
    Invalid MEX-file
        'C:\XXXXX\Programs\cvx-w64\cvx\sdpt3\Solver\Mexfun\mexnnz.mexw64':
        The specified module could not be found.
    Error in checkdepconstr (line 97)
    nnzmatold = mexnnz(AAt);
    Error in sqlpmain (line 87)
    [At,b,y,indeprows,par.depconstr,feasible,par.AAt] = ...
    Error in sqlp (line 241)
    [obj,X3,y,Z3,info,runhist] = ...
    Error in cvx_run_solver (line 50)
       [ varargout{1:nargout} ] = sfunc( inputs{:} );
    Error in cvx_sdpt3>solve (line 362)
    [ obj, xx, y, zz, info ] = cvx_run_solver( @sqlp, blk, Avec, Cvec,
        b, OPTIONS, 'obj', 'x', 'y', 'z', 'info', settings, 5 ); %#ok
    Error in cvxprob/solve (line 429)
                [ x, status, tprec, iters ] = shim.solve( At, b, c,
                    cones, quiet, prec, solv.settings, eargs{:} );
    Error in cvx_end (line 88)
            solve( prob );
    Error in cvx_setup (line 213)
            cvx_end
    ------------------------------------------------------------------------

This kind of error occurs only on Windows, and as best as I can tell, it is due to some missing C++ libraries on the system. To resolve this issue, try installing one of these packages:

I had the same problem and after i have downloaded and setup the C++ library on my windows, the cvx_setup didn’t give the MEX error message. Seemingly, this was the problem. Thank you very much indeed.

1 Like

I also have the same error but do not know how to fix it. Now I know how to solve it, thank you very much.