MATLAB: Does HDL codegeneration fails for the model with a “File format not recognized” error message

HDL Coder

When I try to generate HDL code for my model, then it fails in one of the intermediate steps with this error message:
MEX completed successfully. ### Linking … "C:\matlab\R2015b\bin\win64\mex.exe" -silent LDFLAGS="$LDFLAGS " -output mymodel_cgxe.mexw64 "C:\matlab\R2015b\extern\lib\win64\mingw64\libmx.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libmex.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libmat.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libfixedpoint.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libut.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libmwmathutil.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libemlrt.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libmwcgxert.lib" "-LC:\matlab\R2015b\bin\win64" "-llibmwipp" "C:\matlab\R2015b\extern\lib\win64\mingw64\libcovrt.lib" "C:\matlab\R2015b\extern\lib\win64\mingw64\libmwblas.lib" @mymodel_cgxe.mol
C:\matlab\R2015b\bin\win64/libmwipp.dll: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
gmake: *** [mymodel_cgxe.mexw64] Error -1

Best Answer

This issue is caused by using an unsupported version of the MinGW compiler. In Release 2015b MATLAB on Windows only supports MinGW 4.9.2. You can use the "--version" flag on the GCC executable to find our what exact version you have.
See the following page for details on how to install the supported version of MinGW:
 
Related Question