Error during runing the example in Matlab 2019b

Hi, I was following the installation instructions to run the example with Matlab 2019b on Win 10. Then I met the following errors. Could you please help me to solve the problem? Thanks!

>> minimal_example_ocp

ans = 

  acados_ocp_opts with properties:

    opts_struct: [1Ă—1 struct]

--------------------------------------------------------------
Structure detection for path cost
Cost function is quadratic -> Reformulating as linear_ls cost.


reformulated cost term in linear least squares form with:
cost = 0.5 * || Vx * x + Vu * u + Vz * z - y_ref ||_W

Vx
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1
     0     0     0     0


Vu
     0
     0
     0
     0
     1


Vz

W
   1.0e+03 *

    1.0000         0         0         0         0
         0    1.0000         0         0         0
         0         0    0.0000         0         0
         0         0         0    0.0000         0
         0         0         0         0    0.0000


y_ref
     0
     0
     0
     0
     0


y (symbolic)
[p, theta, v, dtheta, F]

NOTE: These numerical values can be updated online using the appropriate setters.
--------------------------------------------------------------
--------------------------------------------------------------
Structure detection for terminal cost term
Cost function is quadratic -> Reformulating as linear_ls cost.


reformulated cost term in linear least squares form with:
cost = 0.5 * || Vx * x + Vu * u + Vz * z - y_ref ||_W

Vx
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1


Vu
     0
     0
     0
     0


Vz

W
   1.0e+03 *

    1.0000         0         0         0
         0    1.0000         0         0
         0         0    0.0000         0
         0         0         0    0.0000


y_ref
     0
     0
     0
     0


y (symbolic)
[p, theta, v, dtheta]

NOTE: These numerical values can be updated online using the appropriate setters.
--------------------------------------------------------------

Constraint detection for path constraints.
constraint 1 is reformulated as bound on u.
F
 
compiling D:\acados\examples\acados_matlab_octave\..\..\interfaces\acados_matlab_octave\ocp_get_cost.c
Building with 'MinGW64 Compiler (C)'.
Error using mex
D:\acados\examples\acados_matlab_octave\..\..\lib\acados.lib(timing.c.obj):timing.c:(.text+0x22): undefined
reference to `clock_gettime'
D:\acados\examples\acados_matlab_octave\..\..\lib\acados.lib(timing.c.obj):timing.c:(.text+0x9): undefined
reference to `clock_gettime'
collect2.exe: error: ld returned 1 exit status


Error in ocp_compile_interface (line 141)
        mex(mex_flags, FLAGS, LDFLAGS, COMPDEFINES, COMPFLAGS, acados_include, acados_interfaces_include,
        external_include, blasfeo_include, hpipm_include,...

Error in acados_ocp (line 184)
                ocp_compile_interface(obj.opts_struct);

Error in minimal_example_ocp (line 115)
ocp = acados_ocp(ocp_model, ocp_opts, simulink_opts);

Thanks for reporting :wave:

This looks like the issue reported here and is likely an issue of (some) mingw versions:

Could you provide your version of MinGW?

Hi, my MinGW version is 6.3.