MATLAB: How to resolve error message about ‘cannot open source file XXX’ in the ‘static code metrics report’

Embedded Coder

The ‘static code metrics report’ cannot be generated successfully because a source file (e.g. “FCC_ModelOutputs.h”) cannot be opened. The error message is like below:

Best Answer

In this case you likely need to add the folder containing “FCC_ModelOutputs.h” in the ‘Include directories’, which is on the ‘Code Generation/Custom Code’ pane in ‘Model Configuration Parameters’.