MATLAB: Do I receive linking errors in Real-Time Workshop 7.6 (R2010b) when I have Fortran libraries referenced

fortran11.1libirclibmlibmmdsimulinksimulink coder

I have an S-Function Builder block with several math functions in the outputs pane. I would like to use the Fortran 'libm' math library instead of the default MATLAB libraries. However, when I add this to the libraries pane of the S-Function builder block, I receive linking errors:
LINK : fatal error LNK1104: cannot open file 'libirc.lib'
But when I add the 'libirc' library to the S-Function Builder block, I get the next set of errors:
libm.lib(libm_error.obj) : error LNK2019: unresolved external symbol __iob referenced in function _write_message
libm.lib(libm_error.obj) : error LNK2019: unresolved external symbol _errno referenced in function ___libm_error_support
static_lib_test.mexw32 : fatal error LNK1120: 2 unresolved externals

Best Answer

To resolve the link errors that you are receiving, it is necessary to add the following Fortran libraries to the Library pane of the S-Function builder block:
libmmd.lib
libm.lib
libirc.lib
Note that the order of these libraries also plays a role on the ability to resolve the links.