[Solved] Matlab Code generate error: failed to generate all binary outputs

When generating Matlab code, the following error is sometimes reported: Failed to generate all binary outputs

You can check if there are any problems as follows.

1. Check if the path of the executed model has spaces in it, if so, delete the spaces or replace them with underscores.
Reason: Sometimes the compiler will remove the space key from the path by default, resulting in incorrect path identification.
2. check whether the compiler path is executed with spaces, if so, reinstall it under the path without spaces
Cause: the same as above.
3. Modify the configuration: Configure–Code Generation–Templates–Generate an exanmple program (check), this option will generate the ert_main.c file after the check.
4. modify the configuration: Configure—Code Generation—Generate code only (check), this option will not execute the makefile when the code is generated.

If it still cannot be solved, please refer to:
https://www.mathworks.com/matlabcentral/answers/474572-failed-to-generate-all-binary-outputs-works-externally-but-will-not-deploy

Read More: