Mex error for use in MATLAB on Windows

Hello Guys:
I used ACADOS for a while and it worked great. But rencently , beacuse of some reason, I installed ACADOS again.

The running environment is : Windows 11; MATLAB R2021b

First , I compiled it with the default installation Settings,


minimal_example_closed_loop.m can work well. But When I changed the solver to osqp and qpoases, MATLAB will crash.

Then, I delte the D:\ToolBox\acados\lib and D:\ToolBox\acados\build folders, and and change the compilation options to recompile.


When run minimal_example_closed_loop.m again, MATLAB will give us an error

Invalid MEX-file
找不到指定的模块(that means ‘Can’t find the specified module’)
Error in pendulum_mex_solver (line 50)
obj.C_ocp = acados_mex_create_pendulum();
Error in acados_ocp (line 209)
obj.t_ocp = mex_solver();
Error in minimal_example_closed_loop (line 125)
ocp = acados_ocp(ocp_model, ocp_opts);

Hope to get your help.
Best wishes


I had a similar problem on a similar setup and was able to solve it using the answer from this thread.

Hope it helps!

Thank you, I will try it.